home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / Developer Essentials Jul 90 / DTS Sample Code / Macintosh Sample Code / Monthly Releases (Compressed) / MacDTS.Sample.Code.90.05.sit / SC.014.CPlusTESample / TEDocument.cp < prev    next >
MacBinary  |  1990-05-01  |  23.8 KB  |  [TEXT/MPS ]

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: MacBinary (archive/macBinary).

ConfidenceProgramDetectionMatch TypeSupport
10% dexvert MacBinary (archive/macBinary) fallback Supported
1% dexvert MS-DOS Code Page Info (other/dosCodePage) ext Unsupported
1% dexvert Text File (text/txt) fallback Supported
100% file MacBinary II, inited, Tue May 1 12:00:00 1990, modified Tue May 1 12:00:00 1990, creator 'MPS ', type ASCII, 22759 bytes "TEDocument.cp" , at 0x5967 1340 bytes resource default (weak)
99% file data default
74% TrID Macintosh plain text (MacBinary) default
25% TrID MacBinary 2 default (weak)
100% siegfried fmt/1762 MacBinary (II) default
100% lsar MacBinary default


id metadata
keyvalue
macFileType[TEXT]
macFileCreator[MPS ]



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 0d 54 45 44 6f 63 75 | 6d 65 6e 74 2e 63 70 00 |..TEDocu|ment.cp.|
|00000010| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 54 45 58 54 4d 50 53 | 20 01 00 00 00 00 00 00 |.TEXTMPS| .......|
|00000050| 00 00 00 00 00 58 e7 00 | 00 05 3c a2 63 63 00 a2 |.....X..|..<.cc..|
|00000060| 63 63 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |cc......|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 e0 ab 00 00 |........|........|
|00000080| 2f 2a 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |/*------|--------|
|00000090| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000a0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000b0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000c0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000000d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 0d 0d 09 50 |--------|----...P|
|000000e0| 72 6f 67 72 61 6d 3a 09 | 43 50 6c 75 73 54 45 53 |rogram:.|CPlusTES|
|000000f0| 61 6d 70 6c 65 20 32 2e | 30 0d 09 46 69 6c 65 3a |ample 2.|0..File:|
|00000100| 09 09 54 45 44 6f 63 75 | 6d 65 6e 74 2e 63 70 0d |..TEDocu|ment.cp.|
|00000110| 20 20 20 20 55 73 65 73 | 3a 20 20 20 20 20 20 20 | Uses|: |
|00000120| 54 45 44 6f 63 75 6d 65 | 6e 74 2e 68 0d 09 20 20 |TEDocume|nt.h.. |
|00000130| 20 20 20 20 20 20 20 20 | 20 20 54 45 53 61 6d 70 | | TESamp|
|00000140| 6c 65 2e 68 0d 0d 09 62 | 79 20 41 6e 64 72 65 77 |le.h...b|y Andrew|
|00000150| 20 53 68 65 62 61 6e 6f | 77 0d 09 6f 66 20 41 70 | Shebano|w..of Ap|
|00000160| 70 6c 65 20 4d 61 63 69 | 6e 74 6f 73 68 20 44 65 |ple Maci|ntosh De|
|00000170| 76 65 6c 6f 70 65 72 20 | 54 65 63 68 6e 69 63 61 |veloper |Technica|
|00000180| 6c 20 53 75 70 70 6f 72 | 74 0d 0d 09 43 6f 70 79 |l Suppor|t...Copy|
|00000190| 72 69 67 68 74 20 a9 20 | 31 39 38 39 2d 31 39 39 |right . |1989-199|
|000001a0| 30 20 41 70 70 6c 65 20 | 43 6f 6d 70 75 74 65 72 |0 Apple |Computer|
|000001b0| 2c 20 49 6e 63 2e 0d 09 | 41 6c 6c 20 72 69 67 68 |, Inc...|All righ|
|000001c0| 74 73 20 72 65 73 65 72 | 76 65 64 2e 0d 0d 2d 2d |ts reser|ved...--|
|000001d0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000001e0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|000001f0| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000200| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000210| 2d 2d 2d 2d 2d 2d 2d 2d | 2d 2d 2d 2d 2d 2d 2d 2d |--------|--------|
|00000220| 2d 2d 2d 2d 2d 2d 2d 2d | 2a 2f 0d 0d 2f 2f 20 4d |--------|*/..// M|
|00000230| 61 63 20 49 6e 63 6c 75 | 64 65 73 0d 23 69 66 6e |ac Inclu|des.#ifn|
|00000240| 64 65 66 20 5f 5f 54 59 | 50 45 53 5f 5f 0d 23 69 |def __TY|PES__.#i|
|00000250| 6e 63 6c 75 64 65 20 3c | 54 79 70 65 73 2e 68 3e |nclude <|Types.h>|
|00000260| 0d 23 65 6e 64 69 66 0d | 23 69 66 6e 64 65 66 20 |.#endif.|#ifndef |
|00000270| 5f 5f 51 55 49 43 4b 44 | 52 41 57 5f 5f 0d 23 69 |__QUICKD|RAW__.#i|
|00000280| 6e 63 6c 75 64 65 20 3c | 51 75 69 63 6b 44 72 61 |nclude <|QuickDra|
|00000290| 77 2e 68 3e 0d 23 65 6e | 64 69 66 0d 23 69 66 6e |w.h>.#en|dif.#ifn|
|000002a0| 64 65 66 20 5f 5f 46 4f | 4e 54 53 5f 5f 0d 23 69 |def __FO|NTS__.#i|
|000002b0| 6e 63 6c 75 64 65 20 3c | 46 6f 6e 74 73 2e 68 3e |nclude <|Fonts.h>|
|000002c0| 0d 23 65 6e 64 69 66 0d | 23 69 66 6e 64 65 66 20 |.#endif.|#ifndef |
|000002d0| 5f 5f 45 56 45 4e 54 53 | 5f 5f 0d 23 69 6e 63 6c |__EVENTS|__.#incl|
|000002e0| 75 64 65 20 3c 45 76 65 | 6e 74 73 2e 68 3e 0d 23 |ude <Eve|nts.h>.#|
|000002f0| 65 6e 64 69 66 0d 23 69 | 66 6e 64 65 66 20 5f 5f |endif.#i|fndef __|
|00000300| 43 4f 4e 54 52 4f 4c 53 | 5f 5f 0d 23 69 6e 63 6c |CONTROLS|__.#incl|
|00000310| 75 64 65 20 3c 43 6f 6e | 74 72 6f 6c 73 2e 68 3e |ude <Con|trols.h>|
|00000320| 0d 23 65 6e 64 69 66 0d | 23 69 66 6e 64 65 66 20 |.#endif.|#ifndef |
|00000330| 5f 5f 57 49 4e 44 4f 57 | 53 5f 5f 0d 23 69 6e 63 |__WINDOW|S__.#inc|
|00000340| 6c 75 64 65 20 3c 57 69 | 6e 64 6f 77 73 2e 68 3e |lude <Wi|ndows.h>|
|00000350| 0d 23 65 6e 64 69 66 0d | 23 69 66 6e 64 65 66 20 |.#endif.|#ifndef |
|00000360| 5f 5f 4d 45 4e 55 53 5f | 5f 0d 23 69 6e 63 6c 75 |__MENUS_|_.#inclu|
|00000370| 64 65 20 3c 4d 65 6e 75 | 73 2e 68 3e 0d 23 65 6e |de <Menu|s.h>.#en|
|00000380| 64 69 66 0d 23 69 66 6e | 64 65 66 20 5f 5f 54 45 |dif.#ifn|def __TE|
|00000390| 58 54 45 44 49 54 5f 5f | 0d 23 69 6e 63 6c 75 64 |XTEDIT__|.#includ|
|000003a0| 65 20 3c 54 65 78 74 45 | 64 69 74 2e 68 3e 0d 23 |e <TextE|dit.h>.#|
|000003b0| 65 6e 64 69 66 0d 23 69 | 66 6e 64 65 66 20 5f 5f |endif.#i|fndef __|
|000003c0| 44 49 41 4c 4f 47 53 5f | 5f 0d 23 69 6e 63 6c 75 |DIALOGS_|_.#inclu|
|000003d0| 64 65 20 3c 44 69 61 6c | 6f 67 73 2e 68 3e 0d 23 |de <Dial|ogs.h>.#|
|000003e0| 65 6e 64 69 66 0d 23 69 | 66 6e 64 65 66 20 5f 5f |endif.#i|fndef __|
|000003f0| 44 45 53 4b 5f 5f 0d 23 | 69 6e 63 6c 75 64 65 20 |DESK__.#|include |
|00000400| 3c 44 65 73 6b 2e 68 3e | 0d 23 65 6e 64 69 66 0d |<Desk.h>|.#endif.|
|00000410| 23 69 66 6e 64 65 66 20 | 5f 5f 53 43 52 41 50 5f |#ifndef |__SCRAP_|
|00000420| 5f 0d 23 69 6e 63 6c 75 | 64 65 20 3c 53 63 72 61 |_.#inclu|de <Scra|
|00000430| 70 2e 68 3e 0d 23 65 6e | 64 69 66 0d 23 69 66 6e |p.h>.#en|dif.#ifn|
|00000440| 64 65 66 20 5f 5f 54 4f | 4f 4c 55 54 49 4c 53 5f |def __TO|OLUTILS_|
|00000450| 5f 0d 23 69 6e 63 6c 75 | 64 65 20 3c 54 6f 6f 6c |_.#inclu|de <Tool|
|00000460| 55 74 69 6c 73 2e 68 3e | 0d 23 65 6e 64 69 66 0d |Utils.h>|.#endif.|
|00000470| 23 69 66 6e 64 65 66 20 | 5f 5f 4d 45 4d 4f 52 59 |#ifndef |__MEMORY|
|00000480| 5f 5f 0d 23 69 6e 63 6c | 75 64 65 20 3c 4d 65 6d |__.#incl|ude <Mem|
|00000490| 6f 72 79 2e 68 3e 0d 23 | 65 6e 64 69 66 0d 23 69 |ory.h>.#|endif.#i|
|000004a0| 66 6e 64 65 66 20 5f 5f | 53 45 47 4c 4f 41 44 5f |fndef __|SEGLOAD_|
|000004b0| 5f 0d 23 69 6e 63 6c 75 | 64 65 20 3c 53 65 67 4c |_.#inclu|de <SegL|
|000004c0| 6f 61 64 2e 68 3e 0d 23 | 65 6e 64 69 66 0d 23 69 |oad.h>.#|endif.#i|
|000004d0| 66 6e 64 65 66 20 5f 5f | 46 49 4c 45 53 5f 5f 0d |fndef __|FILES__.|
|000004e0| 23 69 6e 63 6c 75 64 65 | 20 3c 46 69 6c 65 73 2e |#include| <Files.|
|000004f0| 68 3e 0d 23 65 6e 64 69 | 66 0d 23 69 66 6e 64 65 |h>.#endi|f.#ifnde|
|00000500| 66 20 5f 5f 4f 53 55 54 | 49 4c 53 5f 5f 0d 23 69 |f __OSUT|ILS__.#i|
|00000510| 6e 63 6c 75 64 65 20 3c | 4f 53 55 74 69 6c 73 2e |nclude <|OSUtils.|
|00000520| 68 3e 0d 23 65 6e 64 69 | 66 0d 23 69 66 6e 64 65 |h>.#endi|f.#ifnde|
|00000530| 66 20 5f 5f 54 52 41 50 | 53 5f 5f 0d 23 69 6e 63 |f __TRAP|S__.#inc|
|00000540| 6c 75 64 65 20 3c 54 72 | 61 70 73 2e 68 3e 0d 23 |lude <Tr|aps.h>.#|
|00000550| 65 6e 64 69 66 0d 23 69 | 66 6e 64 65 66 20 5f 5f |endif.#i|fndef __|
|00000560| 50 41 43 4b 41 47 45 53 | 5f 5f 0d 23 69 6e 63 6c |PACKAGES|__.#incl|
|00000570| 75 64 65 20 3c 50 61 63 | 6b 61 67 65 73 2e 68 3e |ude <Pac|kages.h>|
|00000580| 0d 23 65 6e 64 69 66 0d | 23 69 66 6e 64 65 66 20 |.#endif.|#ifndef |
|00000590| 5f 5f 45 52 52 4f 52 53 | 5f 5f 0d 23 69 6e 63 6c |__ERRORS|__.#incl|
|000005a0| 75 64 65 20 3c 45 72 72 | 6f 72 73 2e 68 3e 0d 23 |ude <Err|ors.h>.#|
|000005b0| 65 6e 64 69 66 0d 0d 23 | 69 66 6e 64 65 66 20 5f |endif..#|ifndef _|
|000005c0| 5f 54 45 44 4f 43 55 4d | 45 4e 54 5f 5f 0d 23 69 |_TEDOCUM|ENT__.#i|
|000005d0| 6e 63 6c 75 64 65 20 22 | 54 45 44 6f 63 75 6d 65 |nclude "|TEDocume|
|000005e0| 6e 74 2e 68 22 0d 23 65 | 6e 64 69 66 0d 23 69 66 |nt.h".#e|ndif.#if|
|000005f0| 6e 64 65 66 20 5f 5f 54 | 45 53 41 4d 50 4c 45 5f |ndef __T|ESAMPLE_|
|00000600| 5f 0d 23 69 6e 63 6c 75 | 64 65 20 22 54 45 53 61 |_.#inclu|de "TESa|
|00000610| 6d 70 6c 65 2e 68 22 0d | 23 65 6e 64 69 66 0d 0d |mple.h".|#endif..|
|00000620| 65 78 74 65 72 6e 20 22 | 43 22 20 7b 0d 09 2f 2f |extern "|C" {..//|
|00000630| 20 70 72 6f 74 6f 74 79 | 70 65 73 20 66 6f 72 20 | prototy|pes for |
|00000640| 66 75 6e 63 74 69 6f 6e | 73 20 74 68 61 74 20 63 |function|s that c|
|00000650| 61 6e 27 74 20 62 65 6c | 6f 6e 67 20 74 6f 20 54 |an't bel|ong to T|
|00000660| 45 44 6f 63 75 6d 65 6e | 74 2c 20 62 75 74 0d 09 |EDocumen|t, but..|
|00000670| 2f 2f 20 77 68 69 63 68 | 20 61 72 65 20 63 6c 6f |// which| are clo|
|00000680| 73 65 6c 79 20 74 69 65 | 64 20 69 6e 74 6f 20 6f |sely tie|d into o|
|00000690| 75 72 20 64 6f 63 75 6d | 65 6e 74 73 0d 09 70 61 |ur docum|ents..pa|
|000006a0| 73 63 61 6c 20 43 6c 69 | 6b 4c 6f 6f 70 50 72 6f |scal Cli|kLoopPro|
|000006b0| 63 50 74 72 20 47 65 74 | 4f 6c 64 43 6c 69 6b 4c |cPtr Get|OldClikL|
|000006c0| 6f 6f 70 28 29 3b 0d 09 | 70 61 73 63 61 6c 20 76 |oop();..|pascal v|
|000006d0| 6f 69 64 20 50 61 73 63 | 61 6c 43 6c 69 6b 4c 6f |oid Pasc|alClikLo|
|000006e0| 6f 70 28 29 3b 0d 09 76 | 6f 69 64 20 43 6f 6d 6d |op();..v|oid Comm|
|000006f0| 6f 6e 41 63 74 69 6f 6e | 28 43 6f 6e 74 72 6f 6c |onAction|(Control|
|00000700| 48 61 6e 64 6c 65 20 63 | 6f 6e 74 72 6f 6c 2c 73 |Handle c|ontrol,s|
|00000710| 68 6f 72 74 2a 20 61 6d | 6f 75 6e 74 29 3b 0d 09 |hort* am|ount);..|
|00000720| 70 61 73 63 61 6c 20 76 | 6f 69 64 20 56 41 63 74 |pascal v|oid VAct|
|00000730| 69 6f 6e 50 72 6f 63 28 | 43 6f 6e 74 72 6f 6c 48 |ionProc(|ControlH|
|00000740| 61 6e 64 6c 65 20 63 6f | 6e 74 72 6f 6c 2c 73 68 |andle co|ntrol,sh|
|00000750| 6f 72 74 20 70 61 72 74 | 29 3b 0d 09 70 61 73 63 |ort part|);..pasc|
|00000760| 61 6c 20 76 6f 69 64 20 | 48 41 63 74 69 6f 6e 50 |al void |HActionP|
|00000770| 72 6f 63 28 43 6f 6e 74 | 72 6f 6c 48 61 6e 64 6c |roc(Cont|rolHandl|
|00000780| 65 20 63 6f 6e 74 72 6f | 6c 2c 73 68 6f 72 74 20 |e contro|l,short |
|00000790| 70 61 72 74 29 3b 0d 09 | 2f 2f 20 74 68 69 73 20 |part);..|// this |
|000007a0| 72 6f 75 74 69 6e 65 20 | 69 73 20 77 72 69 74 74 |routine |is writt|
|000007b0| 65 6e 20 69 6e 20 41 73 | 73 65 6d 62 6c 65 72 2c |en in As|sembler,|
|000007c0| 20 73 69 6e 63 65 20 69 | 74 20 6e 65 65 64 73 20 | since i|t needs |
|000007d0| 74 6f 20 74 77 65 61 6b | 20 72 65 67 69 73 74 65 |to tweak| registe|
|000007e0| 72 73 0d 09 70 61 73 63 | 61 6c 20 76 6f 69 64 20 |rs..pasc|al void |
|000007f0| 41 53 4d 43 4c 49 4b 4c | 4f 4f 50 28 29 3b 0d 7d |ASMCLIKL|OOP();.}|
|00000800| 3b 0d 0d 2f 2f 20 6b 54 | 65 78 74 4d 61 72 67 69 |;..// kT|extMargi|
|00000810| 6e 20 69 73 20 74 68 65 | 20 6e 75 6d 62 65 72 20 |n is the| number |
|00000820| 6f 66 20 70 69 78 65 6c | 73 20 77 65 20 6c 65 61 |of pixel|s we lea|
|00000830| 76 65 20 62 6c 61 6e 6b | 20 61 74 20 74 68 65 20 |ve blank| at the |
|00000840| 65 64 67 65 20 6f 66 20 | 74 68 65 20 77 69 6e 64 |edge of |the wind|
|00000850| 6f 77 2e 0d 63 6f 6e 73 | 74 20 73 68 6f 72 74 20 |ow..cons|t short |
|00000860| 6b 54 65 78 74 4d 61 72 | 67 69 6e 20 3d 20 32 3b |kTextMar|gin = 2;|
|00000870| 0d 0d 2f 2f 20 6b 4d 61 | 78 44 6f 63 57 69 64 74 |..// kMa|xDocWidt|
|00000880| 68 20 69 73 20 61 6e 20 | 61 72 62 69 74 72 61 72 |h is an |arbitrar|
|00000890| 79 20 6e 75 6d 62 65 72 | 20 75 73 65 64 20 74 6f |y number| used to|
|000008a0| 20 73 70 65 63 69 66 79 | 20 74 68 65 20 77 69 64 | specify| the wid|
|000008b0| 74 68 20 6f 66 20 74 68 | 65 20 54 45 52 65 63 27 |th of th|e TERec'|
|000008c0| 73 0d 2f 2f 20 64 65 73 | 74 69 6e 61 74 69 6f 6e |s.// des|tination|
|000008d0| 20 72 65 63 74 61 6e 67 | 6c 65 20 73 6f 20 74 68 | rectang|le so th|
|000008e0| 61 74 20 77 6f 72 64 20 | 77 72 61 70 20 61 6e 64 |at word |wrap and|
|000008f0| 20 68 6f 72 69 7a 6f 6e | 74 61 6c 20 73 63 72 6f | horizon|tal scro|
|00000900| 6c 6c 69 6e 67 20 63 61 | 6e 20 62 65 0d 2f 2f 20 |lling ca|n be.// |
|00000910| 64 65 6d 6f 6e 73 74 72 | 61 74 65 64 2e 0d 63 6f |demonstr|ated..co|
|00000920| 6e 73 74 20 73 68 6f 72 | 74 09 6b 4d 61 78 44 6f |nst shor|t.kMaxDo|
|00000930| 63 57 69 64 74 68 20 3d | 20 35 37 36 3b 0d 0d 2f |cWidth =| 576;../|
|00000940| 2f 20 6b 4d 69 6e 44 6f | 63 44 69 6d 20 69 73 20 |/ kMinDo|cDim is |
|00000950| 75 73 65 64 20 74 6f 20 | 6c 69 6d 69 74 20 74 68 |used to |limit th|
|00000960| 65 20 6d 69 6e 69 6d 75 | 6d 20 64 69 6d 65 6e 73 |e minimu|m dimens|
|00000970| 69 6f 6e 20 6f 66 20 61 | 20 77 69 6e 64 6f 77 20 |ion of a| window |
|00000980| 77 68 65 6e 20 47 72 6f | 77 57 69 6e 64 6f 77 0d |when Gro|wWindow.|
|00000990| 2f 2f 20 69 73 20 63 61 | 6c 6c 65 64 2e 0d 63 6f |// is ca|lled..co|
|000009a0| 6e 73 74 20 73 68 6f 72 | 74 09 6b 4d 69 6e 44 6f |nst shor|t.kMinDo|
|000009b0| 63 44 69 6d 20 3d 20 36 | 34 3b 0d 0d 2f 2f 20 6b |cDim = 6|4;..// k|
|000009c0| 4d 61 78 54 45 4c 65 6e | 67 74 68 20 69 73 20 61 |MaxTELen|gth is a|
|000009d0| 6e 20 61 72 62 69 74 72 | 61 72 79 20 6e 75 6d 62 |n arbitr|ary numb|
|000009e0| 65 72 20 75 73 65 64 20 | 74 6f 20 6c 69 6d 69 74 |er used |to limit|
|000009f0| 20 74 68 65 20 6c 65 6e | 67 74 68 20 6f 66 20 74 | the len|gth of t|
|00000a00| 65 78 74 20 69 6e 20 74 | 68 65 20 54 45 52 65 63 |ext in t|he TERec|
|00000a10| 0d 2f 2f 20 73 6f 20 74 | 68 61 74 20 76 61 72 69 |.// so t|hat vari|
|00000a20| 6f 75 73 20 65 72 72 6f | 72 73 20 77 6f 6e 27 74 |ous erro|rs won't|
|00000a30| 20 6f 63 63 75 72 20 66 | 72 6f 6d 20 74 6f 6f 20 | occur f|rom too |
|00000a40| 6d 61 6e 79 20 63 68 61 | 72 61 63 74 65 72 73 20 |many cha|racters |
|00000a50| 62 65 69 6e 67 20 69 6e | 20 74 68 65 20 74 65 78 |being in| the tex|
|00000a60| 74 2e 0d 63 6f 6e 73 74 | 20 73 68 6f 72 74 09 6b |t..const| short.k|
|00000a70| 4d 61 78 54 45 4c 65 6e | 67 74 68 20 3d 20 33 32 |MaxTELen|gth = 32|
|00000a80| 30 30 30 3b 0d 0d 2f 2f | 20 6b 43 6f 6e 74 72 6f |000;..//| kContro|
|00000a90| 6c 49 6e 76 69 73 69 62 | 6c 65 20 69 73 20 75 73 |lInvisib|le is us|
|00000aa0| 65 64 20 74 68 65 20 73 | 61 6d 65 20 77 61 79 20 |ed the s|ame way |
|00000ab0| 74 6f 20 27 74 75 72 6e | 20 6f 6e 27 20 74 68 65 |to 'turn| on' the|
|00000ac0| 20 63 6f 6e 74 72 6f 6c | 2e 0d 63 6f 6e 73 74 20 | control|..const |
|00000ad0| 73 68 6f 72 74 20 6b 43 | 6f 6e 74 72 6f 6c 56 69 |short kC|ontrolVi|
|00000ae0| 73 69 62 6c 65 20 3d 20 | 30 78 46 46 3b 0d 0d 2f |sible = |0xFF;../|
|00000af0| 2f 20 53 63 72 6f 6c 6c | 42 61 72 41 64 6a 75 73 |/ Scroll|BarAdjus|
|00000b00| 74 2c 20 47 72 6f 77 42 | 6f 78 41 64 6a 75 73 74 |t, GrowB|oxAdjust|
|00000b10| 2c 20 61 6e 64 20 53 63 | 72 6f 6c 6c 42 61 72 20 |, and Sc|rollBar |
|00000b20| 77 69 64 74 68 20 61 72 | 65 20 75 73 65 64 20 69 |width ar|e used i|
|00000b30| 6e 20 63 61 6c 63 75 6c | 61 74 69 6e 67 0d 2f 2f |n calcul|ating.//|
|00000b40| 20 76 61 6c 75 65 73 20 | 66 6f 72 20 63 6f 6e 74 | values |for cont|
|00000b50| 72 6f 6c 20 70 6f 73 69 | 74 69 6f 6e 69 6e 67 20 |rol posi|tioning |
|00000b60| 61 6e 64 20 73 69 7a 69 | 6e 67 2e 0d 63 6f 6e 73 |and sizi|ng..cons|
|00000b70| 74 20 73 68 6f 72 74 20 | 6b 53 63 72 6f 6c 6c 62 |t short |kScrollb|
|00000b80| 61 72 41 64 6a 75 73 74 | 20 3d 20 31 35 3b 0d 63 |arAdjust| = 15;.c|
|00000b90| 6f 6e 73 74 20 73 68 6f | 72 74 20 6b 47 72 6f 77 |onst sho|rt kGrow|
|00000ba0| 62 6f 78 41 64 6a 75 73 | 74 20 3d 20 31 35 3b 0d |boxAdjus|t = 15;.|
|00000bb0| 63 6f 6e 73 74 20 73 68 | 6f 72 74 20 6b 53 63 72 |const sh|ort kScr|
|00000bc0| 6f 6c 6c 62 61 72 57 69 | 64 74 68 20 3d 20 31 36 |ollbarWi|dth = 16|
|00000bd0| 3b 0d 0d 2f 2f 20 6b 54 | 45 53 6c 6f 70 20 70 72 |;..// kT|ESlop pr|
|00000be0| 6f 76 69 64 65 73 20 73 | 6f 6d 65 20 65 78 74 72 |ovides s|ome extr|
|00000bf0| 61 20 73 65 63 75 72 69 | 74 79 20 77 68 65 6e 20 |a securi|ty when |
|00000c00| 70 72 65 2d 66 6c 69 67 | 68 74 69 6e 67 20 65 64 |pre-flig|hting ed|
|00000c10| 69 74 20 63 6f 6d 6d 61 | 6e 64 73 2e 0d 63 6f 6e |it comma|nds..con|
|00000c20| 73 74 20 73 68 6f 72 74 | 20 6b 54 45 53 6c 6f 70 |st short| kTESlop|
|00000c30| 20 3d 20 31 30 32 34 3b | 0d 0d 2f 2f 20 6b 53 63 | = 1024;|..// kSc|
|00000c40| 72 6f 6c 6c 54 77 65 65 | 6b 20 63 6f 6d 70 65 6e |rollTwee|k compen|
|00000c50| 73 61 74 65 73 20 66 6f | 72 20 6f 66 66 2d 62 79 |sates fo|r off-by|
|00000c60| 2d 6f 6e 65 20 72 65 71 | 75 69 72 65 6d 65 6e 74 |-one req|uirement|
|00000c70| 73 20 6f 66 20 74 68 65 | 20 73 63 72 6f 6c 6c 62 |s of the| scrollb|
|00000c80| 61 72 73 0d 2f 2f 20 74 | 6f 20 68 61 76 65 20 62 |ars.// t|o have b|
|00000c90| 6f 72 64 65 72 73 20 63 | 6f 69 6e 63 69 64 65 20 |orders c|oincide |
|00000ca0| 77 69 74 68 20 74 68 65 | 20 67 72 6f 77 62 6f 78 |with the| growbox|
|00000cb0| 2e 0d 63 6f 6e 73 74 20 | 73 68 6f 72 74 20 6b 53 |..const |short kS|
|00000cc0| 63 72 6f 6c 6c 54 77 65 | 65 6b 20 3d 20 32 3b 0d |crollTwe|ek = 2;.|
|00000cd0| 0d 2f 2f 20 6b 43 72 43 | 68 61 72 20 69 73 20 75 |.// kCrC|har is u|
|00000ce0| 73 65 64 20 74 6f 20 6d | 61 74 63 68 20 77 69 74 |sed to m|atch wit|
|00000cf0| 68 20 61 20 63 61 72 72 | 69 61 67 65 20 72 65 74 |h a carr|iage ret|
|00000d00| 75 72 6e 20 77 68 65 6e | 20 63 61 6c 63 75 6c 61 |urn when| calcula|
|00000d10| 74 69 6e 67 20 74 68 65 | 0d 2f 2f 20 6e 75 6d 62 |ting the|.// numb|
|00000d20| 65 72 20 6f 66 20 6c 69 | 6e 65 73 20 69 6e 20 74 |er of li|nes in t|
|00000d30| 68 65 20 54 65 78 74 45 | 64 69 74 20 72 65 63 6f |he TextE|dit reco|
|00000d40| 72 64 2e 20 6b 44 65 6c | 43 68 61 72 20 69 73 20 |rd. kDel|Char is |
|00000d50| 75 73 65 64 20 74 6f 20 | 63 68 65 63 6b 20 66 6f |used to |check fo|
|00000d60| 72 0d 2f 2f 20 64 65 6c | 65 74 65 20 69 6e 20 6b |r.// del|ete in k|
|00000d70| 65 79 44 6f 77 6e 73 2e | 0d 63 6f 6e 73 74 20 73 |eyDowns.|.const s|
|00000d80| 68 6f 72 74 20 6b 43 72 | 43 68 61 72 20 3d 20 31 |hort kCr|Char = 1|
|00000d90| 33 3b 0d 63 6f 6e 73 74 | 20 73 68 6f 72 74 20 6b |3;.const| short k|
|00000da0| 44 65 6c 43 68 61 72 20 | 3d 20 38 3b 0d 0d 2f 2f |DelChar |= 8;..//|
|00000db0| 20 6e 6f 74 69 63 65 20 | 74 68 61 74 20 77 65 20 | notice |that we |
|00000dc0| 70 61 73 73 20 74 68 65 | 20 72 65 73 49 44 20 70 |pass the| resID p|
|00000dd0| 61 72 61 6d 65 74 65 72 | 20 75 70 20 74 6f 20 6f |arameter| up to o|
|00000de0| 75 72 20 62 61 73 65 20 | 63 6c 61 73 73 2c 0d 2f |ur base |class,./|
|00000df0| 2f 20 77 68 69 63 68 20 | 61 63 74 75 61 6c 6c 79 |/ which |actually|
|00000e00| 20 63 72 65 61 74 65 73 | 20 74 68 65 20 77 69 6e | creates| the win|
|00000e10| 64 6f 77 20 66 6f 72 20 | 75 73 0d 54 45 44 6f 63 |dow for |us.TEDoc|
|00000e20| 75 6d 65 6e 74 3a 3a 54 | 45 44 6f 63 75 6d 65 6e |ument::T|EDocumen|
|00000e30| 74 28 73 68 6f 72 74 20 | 72 65 73 49 44 29 09 3a |t(short |resID).:|
|00000e40| 20 54 44 6f 63 75 6d 65 | 6e 74 28 72 65 73 49 44 | TDocume|nt(resID|
|00000e50| 2c 20 6b 54 45 46 69 6c | 65 54 79 70 65 29 0d 7b |, kTEFil|eType).{|
|00000e60| 0d 09 42 6f 6f 6c 65 61 | 6e 20 67 6f 6f 64 3b 0d |..Boolea|n good;.|
|00000e70| 09 52 65 63 74 20 64 65 | 73 74 52 65 63 74 2c 20 |.Rect de|stRect, |
|00000e80| 76 69 65 77 52 65 63 74 | 3b 0d 0d 09 67 6f 6f 64 |viewRect|;...good|
|00000e90| 20 3d 20 66 61 6c 73 65 | 3b 0d 09 53 65 74 50 6f | = false|;..SetPo|
|00000ea0| 72 74 28 66 44 6f 63 57 | 69 6e 64 6f 77 29 3b 0d |rt(fDocW|indow);.|
|00000eb0| 09 47 65 74 54 45 52 65 | 63 74 28 26 76 69 65 77 |.GetTERe|ct(&view|
|00000ec0| 52 65 63 74 29 3b 0d 09 | 64 65 73 74 52 65 63 74 |Rect);..|destRect|
|00000ed0| 20 3d 20 76 69 65 77 52 | 65 63 74 3b 0d 09 64 65 | = viewR|ect;..de|
|00000ee0| 73 74 52 65 63 74 2e 72 | 69 67 68 74 20 3d 20 64 |stRect.r|ight = d|
|00000ef0| 65 73 74 52 65 63 74 2e | 6c 65 66 74 20 2b 20 6b |estRect.|left + k|
|00000f00| 4d 61 78 44 6f 63 57 69 | 64 74 68 3b 0d 09 66 44 |MaxDocWi|dth;..fD|
|00000f10| 6f 63 54 45 20 3d 20 54 | 45 4e 65 77 28 26 64 65 |ocTE = T|ENew(&de|
|00000f20| 73 74 52 65 63 74 2c 20 | 26 76 69 65 77 52 65 63 |stRect, |&viewRec|
|00000f30| 74 29 3b 0d 09 46 61 69 | 6c 4e 49 4c 28 66 44 6f |t);..Fai|lNIL(fDo|
|00000f40| 63 54 45 29 3b 0d 0d 09 | 2f 2f 20 73 65 74 20 75 |cTE);...|// set u|
|00000f50| 70 20 54 45 20 72 65 63 | 6f 72 64 0d 09 41 64 6a |p TE rec|ord..Adj|
|00000f60| 75 73 74 56 69 65 77 52 | 65 63 74 28 29 3b 0d 09 |ustViewR|ect();..|
|00000f70| 54 45 41 75 74 6f 56 69 | 65 77 28 74 72 75 65 2c |TEAutoVi|ew(true,|
|00000f80| 20 66 44 6f 63 54 45 29 | 3b 0d 09 66 44 6f 63 43 | fDocTE)|;..fDocC|
|00000f90| 6c 69 6b 20 3d 20 28 2a | 66 44 6f 63 54 45 29 2d |lik = (*|fDocTE)-|
|00000fa0| 3e 63 6c 69 6b 4c 6f 6f | 70 3b 0d 09 28 2a 66 44 |>clikLoo|p;..(*fD|
|00000fb0| 6f 63 54 45 29 2d 3e 63 | 6c 69 6b 4c 6f 6f 70 20 |ocTE)->c|likLoop |
|00000fc0| 3d 20 28 43 6c 69 6b 4c | 6f 6f 70 50 72 6f 63 50 |= (ClikL|oopProcP|
|00000fd0| 74 72 29 20 41 53 4d 43 | 4c 49 4b 4c 4f 4f 50 3b |tr) ASMC|LIKLOOP;|
|00000fe0| 0d 0d 09 66 44 6f 63 56 | 53 63 72 6f 6c 6c 20 3d |...fDocV|Scroll =|
|00000ff0| 20 66 44 6f 63 48 53 63 | 72 6f 6c 6c 20 3d 20 6e | fDocHSc|roll = n|
|00001000| 69 6c 3b 0d 0d 09 2f 2f | 20 67 65 74 20 76 65 72 |il;...//| get ver|
|00001010| 74 69 63 61 6c 20 73 63 | 72 6f 6c 6c 62 61 72 0d |tical sc|rollbar.|
|00001020| 09 54 52 59 0d 09 20 20 | 7b 0d 09 09 66 44 6f 63 |.TRY.. |{...fDoc|
|00001030| 56 53 63 72 6f 6c 6c 20 | 3d 20 47 65 74 4e 65 77 |VScroll |= GetNew|
|00001040| 43 6f 6e 74 72 6f 6c 28 | 72 56 53 63 72 6f 6c 6c |Control(|rVScroll|
|00001050| 2c 20 66 44 6f 63 57 69 | 6e 64 6f 77 29 3b 0d 09 |, fDocWi|ndow);..|
|00001060| 09 46 61 69 6c 4e 49 4c | 52 65 73 6f 75 72 63 65 |.FailNIL|Resource|
|00001070| 28 66 44 6f 63 56 53 63 | 72 6f 6c 6c 29 3b 0d 09 |(fDocVSc|roll);..|
|00001080| 09 66 44 6f 63 48 53 63 | 72 6f 6c 6c 20 3d 20 47 |.fDocHSc|roll = G|
|00001090| 65 74 4e 65 77 43 6f 6e | 74 72 6f 6c 28 72 48 53 |etNewCon|trol(rHS|
|000010a0| 63 72 6f 6c 6c 2c 20 66 | 44 6f 63 57 69 6e 64 6f |croll, f|DocWindo|
|000010b0| 77 29 3b 0d 09 09 46 61 | 69 6c 4e 49 4c 52 65 73 |w);...Fa|ilNILRes|
|000010c0| 6f 75 72 63 65 28 66 44 | 6f 63 48 53 63 72 6f 6c |ource(fD|ocHScrol|
|000010d0| 6c 29 3b 0d 09 20 20 7d | 0d 09 52 45 43 4f 56 45 |l);.. }|..RECOVE|
|000010e0| 52 0d 09 20 20 7b 0d 09 | 09 54 45 44 69 73 70 6f |R.. {..|.TEDispo|
|000010f0| 73 65 28 66 44 6f 63 54 | 45 29 3b 0d 09 09 69 66 |se(fDocT|E);...if|
|00001100| 20 28 66 44 6f 63 56 53 | 63 72 6f 6c 6c 29 0d 09 | (fDocVS|croll)..|
|00001110| 09 20 20 64 65 6c 65 74 | 65 20 66 44 6f 63 56 53 |. delet|e fDocVS|
|00001120| 63 72 6f 6c 6c 3b 0d 09 | 09 69 66 20 28 66 44 6f |croll;..|.if (fDo|
|00001130| 63 48 53 63 72 6f 6c 6c | 29 0d 09 09 20 20 64 65 |cHScroll|)... de|
|00001140| 6c 65 74 65 20 66 44 6f | 63 48 53 63 72 6f 6c 6c |lete fDo|cHScroll|
|00001150| 3b 0d 09 09 46 61 69 6c | 4e 65 77 4d 65 73 73 61 |;...Fail|NewMessa|
|00001160| 67 65 28 65 4e 6f 57 69 | 6e 64 6f 77 2c 67 46 61 |ge(eNoWi|ndow,gFa|
|00001170| 69 6c 4d 65 73 73 61 67 | 65 2c 6b 54 45 44 6f 63 |ilMessag|e,kTEDoc|
|00001180| 45 72 72 53 74 72 69 6e | 67 73 29 3b 0d 09 20 20 |ErrStrin|gs);.. |
|00001190| 7d 0d 09 45 4e 44 54 52 | 59 0d 0d 09 41 64 6a 75 |}..ENDTR|Y...Adju|
|000011a0| 73 74 53 63 72 6f 6c 6c | 56 61 6c 75 65 73 28 74 |stScroll|Values(t|
|000011b0| 72 75 65 29 3b 0d 09 53 | 68 6f 77 57 69 6e 64 6f |rue);..S|howWindo|
|000011c0| 77 28 66 44 6f 63 57 69 | 6e 64 6f 77 29 3b 0d 09 |w(fDocWi|ndow);..|
|000011d0| 53 65 6c 65 63 74 57 69 | 6e 64 6f 77 28 66 44 6f |SelectWi|ndow(fDo|
|000011e0| 63 57 69 6e 64 6f 77 29 | 3b 0d 7d 0d 0d 54 45 44 |cWindow)|;.}..TED|
|000011f0| 6f 63 75 6d 65 6e 74 3a | 3a 7e 54 45 44 6f 63 75 |ocument:|:~TEDocu|
|00001200| 6d 65 6e 74 28 29 0d 7b | 0d 09 48 69 64 65 57 69 |ment().{|..HideWi|
|00001210| 6e 64 6f 77 28 66 44 6f | 63 57 69 6e 64 6f 77 29 |ndow(fDo|cWindow)|
|00001220| 3b 0d 09 69 66 20 28 20 | 66 44 6f 63 54 45 20 21 |;..if ( |fDocTE !|
|00001230| 3d 20 6e 69 6c 20 29 0d | 09 20 20 7b 0d 09 09 54 |= nil ).|. {...T|
|00001240| 45 44 69 73 70 6f 73 65 | 28 66 44 6f 63 54 45 29 |EDispose|(fDocTE)|
|00001250| 3b 09 09 09 2f 2f 20 64 | 69 73 70 6f 73 65 20 74 |;...// d|ispose t|
|00001260| 68 65 20 54 45 48 61 6e | 64 6c 65 20 69 66 20 77 |he TEHan|dle if w|
|00001270| 65 20 67 6f 74 20 66 61 | 72 20 65 6e 6f 75 67 68 |e got fa|r enough|
|00001280| 20 74 6f 20 6d 61 6b 65 | 20 6f 6e 65 0d 09 20 20 | to make| one.. |
|00001290| 7d 0d 09 69 66 20 28 20 | 66 44 6f 63 56 53 63 72 |}..if ( |fDocVScr|
|000012a0| 6f 6c 6c 20 21 3d 20 6e | 69 6c 20 29 0d 09 20 20 |oll != n|il ).. |
|000012b0| 7b 0d 09 09 44 69 73 70 | 6f 73 65 43 6f 6e 74 72 |{...Disp|oseContr|
|000012c0| 6f 6c 28 66 44 6f 63 56 | 53 63 72 6f 6c 6c 29 3b |ol(fDocV|Scroll);|
|000012d0| 0d 09 20 20 7d 0d 09 69 | 66 20 28 20 66 44 6f 63 |.. }..i|f ( fDoc|
|000012e0| 48 53 63 72 6f 6c 6c 20 | 21 3d 20 6e 69 6c 20 29 |HScroll |!= nil )|
|000012f0| 0d 09 20 20 7b 0d 09 09 | 44 69 73 70 6f 73 65 43 |.. {...|DisposeC|
|00001300| 6f 6e 74 72 6f 6c 28 66 | 44 6f 63 48 53 63 72 6f |ontrol(f|DocHScro|
|00001310| 6c 6c 29 3b 0d 09 20 20 | 7d 0d 09 2f 2f 20 62 61 |ll);.. |}..// ba|
|00001320| 73 65 20 63 6c 61 73 73 | 20 64 65 73 74 72 75 63 |se class| destruc|
|00001330| 74 6f 72 20 77 69 6c 6c | 20 64 69 73 70 6f 73 65 |tor will| dispose|
|00001340| 20 6f 66 20 77 69 6e 64 | 6f 77 0d 7d 0d 0d 76 6f | of wind|ow.}..vo|
|00001350| 69 64 20 54 45 44 6f 63 | 75 6d 65 6e 74 3a 3a 44 |id TEDoc|ument::D|
|00001360| 6f 5a 6f 6f 6d 28 73 68 | 6f 72 74 20 70 61 72 74 |oZoom(sh|ort part|
|00001370| 43 6f 64 65 29 0d 7b 0d | 09 52 65 63 74 20 74 52 |Code).{.|.Rect tR|
|00001380| 65 63 74 3b 0d 0d 09 74 | 52 65 63 74 20 3d 20 66 |ect;...t|Rect = f|
|00001390| 44 6f 63 57 69 6e 64 6f | 77 2d 3e 70 6f 72 74 52 |DocWindo|w->portR|
|000013a0| 65 63 74 3b 0d 09 45 72 | 61 73 65 52 65 63 74 28 |ect;..Er|aseRect(|
|000013b0| 26 74 52 65 63 74 29 3b | 0d 09 5a 6f 6f 6d 57 69 |&tRect);|..ZoomWi|
|000013c0| 6e 64 6f 77 28 66 44 6f | 63 57 69 6e 64 6f 77 2c |ndow(fDo|cWindow,|
|000013d0| 20 70 61 72 74 43 6f 64 | 65 2c 20 66 44 6f 63 57 | partCod|e, fDocW|
|000013e0| 69 6e 64 6f 77 20 3d 3d | 20 46 72 6f 6e 74 57 69 |indow ==| FrontWi|
|000013f0| 6e 64 6f 77 28 29 29 3b | 0d 09 41 64 6a 75 73 74 |ndow());|..Adjust|
|00001400| 53 63 72 6f 6c 6c 62 61 | 72 73 28 74 72 75 65 29 |Scrollba|rs(true)|
|00001410| 3b 09 09 2f 2f 20 61 64 | 6a 75 73 74 2c 20 72 65 |;..// ad|just, re|
|00001420| 64 72 61 77 20 61 6e 79 | 77 61 79 0d 09 41 64 6a |draw any|way..Adj|
|00001430| 75 73 74 54 45 28 29 3b | 0d 09 49 6e 76 61 6c 52 |ustTE();|..InvalR|
|00001440| 65 63 74 28 26 74 52 65 | 63 74 29 3b 09 09 09 2f |ect(&tRe|ct);.../|
|00001450| 2f 20 69 6e 76 61 6c 69 | 64 61 74 65 20 74 68 65 |/ invali|date the|
|00001460| 20 77 68 6f 6c 65 20 63 | 6f 6e 74 65 6e 74 0d 09 | whole c|ontent..|
|00001470| 2f 2f 20 74 68 65 20 73 | 63 72 6f 6c 6c 62 61 72 |// the s|crollbar|
|00001480| 73 20 77 65 72 65 20 74 | 61 6b 65 6e 20 63 61 72 |s were t|aken car|
|00001490| 65 20 6f 66 20 62 79 20 | 41 64 6a 75 73 74 53 63 |e of by |AdjustSc|
|000014a0| 72 6f 6c 6c 62 61 72 73 | 2c 20 73 6f 20 76 61 6c |rollbars|, so val|
|000014b0| 69 64 61 74 65 20 d5 65 | 6d 0d 09 74 52 65 63 74 |idate .e|m..tRect|
|000014c0| 20 3d 20 28 2a 66 44 6f | 63 56 53 63 72 6f 6c 6c | = (*fDo|cVScroll|
|000014d0| 29 2d 3e 63 6f 6e 74 72 | 6c 52 65 63 74 3b 0d 09 |)->contr|lRect;..|
|000014e0| 56 61 6c 69 64 52 65 63 | 74 28 26 74 52 65 63 74 |ValidRec|t(&tRect|
|000014f0| 29 3b 0d 09 74 52 65 63 | 74 20 3d 20 28 2a 66 44 |);..tRec|t = (*fD|
|00001500| 6f 63 48 53 63 72 6f 6c | 6c 29 2d 3e 63 6f 6e 74 |ocHScrol|l)->cont|
|00001510| 72 6c 52 65 63 74 3b 0d | 09 56 61 6c 69 64 52 65 |rlRect;.|.ValidRe|
|00001520| 63 74 28 26 74 52 65 63 | 74 29 3b 0d 7d 0d 0d 2f |ct(&tRec|t);.}../|
|00001530| 2f 20 43 61 6c 6c 65 64 | 20 77 68 65 6e 20 61 20 |/ Called| when a |
|00001540| 6d 6f 75 73 65 44 6f 77 | 6e 20 6f 63 63 75 72 73 |mouseDow|n occurs|
|00001550| 20 69 6e 20 74 68 65 20 | 67 72 6f 77 20 62 6f 78 | in the |grow box|
|00001560| 20 6f 66 20 61 6e 20 61 | 63 74 69 76 65 20 77 69 | of an a|ctive wi|
|00001570| 6e 64 6f 77 2e 0d 0d 76 | 6f 69 64 20 54 45 44 6f |ndow...v|oid TEDo|
|00001580| 63 75 6d 65 6e 74 3a 3a | 44 6f 47 72 6f 77 28 45 |cument::|DoGrow(E|
|00001590| 76 65 6e 74 52 65 63 6f | 72 64 2a 20 74 68 65 45 |ventReco|rd* theE|
|000015a0| 76 65 6e 74 29 0d 7b 0d | 09 6c 6f 6e 67 20 67 72 |vent).{.|.long gr|
|000015b0| 6f 77 52 65 73 75 6c 74 | 3b 0d 09 52 65 63 74 20 |owResult|;..Rect |
|000015c0| 74 52 65 63 74 2c 20 74 | 52 65 63 74 32 3b 0d 0d |tRect, t|Rect2;..|
|000015d0| 09 74 52 65 63 74 20 3d | 20 71 64 2e 73 63 72 65 |.tRect =| qd.scre|
|000015e0| 65 6e 42 69 74 73 2e 62 | 6f 75 6e 64 73 3b 0d 09 |enBits.b|ounds;..|
|000015f0| 74 52 65 63 74 2e 6c 65 | 66 74 20 3d 20 6b 4d 69 |tRect.le|ft = kMi|
|00001600| 6e 44 6f 63 44 69 6d 3b | 0d 09 74 52 65 63 74 2e |nDocDim;|..tRect.|
|00001610| 74 6f 70 20 3d 20 6b 4d | 69 6e 44 6f 63 44 69 6d |top = kM|inDocDim|
|00001620| 3b 0d 09 67 72 6f 77 52 | 65 73 75 6c 74 20 3d 20 |;..growR|esult = |
|00001630| 47 72 6f 77 57 69 6e 64 | 6f 77 28 66 44 6f 63 57 |GrowWind|ow(fDocW|
|00001640| 69 6e 64 6f 77 2c 20 74 | 68 65 45 76 65 6e 74 2d |indow, t|heEvent-|
|00001650| 3e 77 68 65 72 65 2c 20 | 26 74 52 65 63 74 29 3b |>where, |&tRect);|
|00001660| 0d 09 2f 2f 20 73 65 65 | 20 69 66 20 69 74 20 72 |..// see| if it r|
|00001670| 65 61 6c 6c 79 20 63 68 | 61 6e 67 65 64 20 73 69 |eally ch|anged si|
|00001680| 7a 65 0d 09 69 66 20 28 | 20 67 72 6f 77 52 65 73 |ze..if (| growRes|
|00001690| 75 6c 74 20 21 3d 20 30 | 20 29 0d 09 20 20 7b 0d |ult != 0| ).. {.|
|000016a0| 09 09 74 52 65 63 74 20 | 3d 20 28 2a 66 44 6f 63 |..tRect |= (*fDoc|
|000016b0| 54 45 29 2d 3e 76 69 65 | 77 52 65 63 74 3b 0d 09 |TE)->vie|wRect;..|
|000016c0| 09 53 69 7a 65 57 69 6e | 64 6f 77 28 66 44 6f 63 |.SizeWin|dow(fDoc|
|000016d0| 57 69 6e 64 6f 77 2c 20 | 4c 6f 57 6f 72 64 28 67 |Window, |LoWord(g|
|000016e0| 72 6f 77 52 65 73 75 6c | 74 29 2c 20 48 69 57 6f |rowResul|t), HiWo|
|000016f0| 72 64 28 67 72 6f 77 52 | 65 73 75 6c 74 29 2c 20 |rd(growR|esult), |
|00001700| 74 72 75 65 29 3b 0d 09 | 09 41 64 6a 75 73 74 53 |true);..|.AdjustS|
|00001710| 63 72 6f 6c 6c 62 61 72 | 73 28 74 72 75 65 29 3b |crollbar|s(true);|
|00001720| 0d 09 09 41 64 6a 75 73 | 74 54 45 28 29 3b 0d 09 |...Adjus|tTE();..|
|00001730| 09 2f 2f 20 63 61 6c 63 | 75 6c 61 74 65 20 26 20 |.// calc|ulate & |
|00001740| 76 61 6c 69 64 61 74 65 | 20 74 68 65 20 72 65 67 |validate| the reg|
|00001750| 69 6f 6e 20 74 68 61 74 | 20 68 61 73 6e d5 74 20 |ion that| hasn.t |
|00001760| 63 68 61 6e 67 65 64 20 | 73 6f 20 69 74 20 77 6f |changed |so it wo|
|00001770| 6e d5 74 20 67 65 74 20 | 72 65 64 72 61 77 6e 0d |n.t get |redrawn.|
|00001780| 09 09 2f 2f 20 4e 6f 74 | 65 3a 20 77 65 20 63 6f |..// Not|e: we co|
|00001790| 70 79 20 72 65 63 74 61 | 6e 67 6c 65 73 20 73 6f |py recta|ngles so|
|000017a0| 20 74 68 61 74 20 77 65 | 20 64 6f 6e 27 74 20 74 | that we| don't t|
|000017b0| 61 6b 65 20 61 64 64 72 | 65 73 73 20 6f 66 20 6f |ake addr|ess of o|
|000017c0| 62 6a 65 63 74 20 66 69 | 65 6c 64 73 2e 0d 09 09 |bject fi|elds....|
|000017d0| 74 52 65 63 74 32 20 3d | 20 28 2a 66 44 6f 63 54 |tRect2 =| (*fDocT|
|000017e0| 45 29 2d 3e 76 69 65 77 | 52 65 63 74 3b 0d 09 09 |E)->view|Rect;...|
|000017f0| 28 76 6f 69 64 29 20 53 | 65 63 74 52 65 63 74 28 |(void) S|ectRect(|
|00001800| 26 74 52 65 63 74 2c 20 | 26 74 52 65 63 74 32 2c |&tRect, |&tRect2,|
|00001810| 20 26 74 52 65 63 74 29 | 3b 0d 09 09 74 52 65 63 | &tRect)|;...tRec|
|00001820| 74 32 20 3d 20 66 44 6f | 63 57 69 6e 64 6f 77 2d |t2 = fDo|cWindow-|
|00001830| 3e 70 6f 72 74 52 65 63 | 74 3b 20 49 6e 76 61 6c |>portRec|t; Inval|
|00001840| 52 65 63 74 28 26 74 52 | 65 63 74 32 29 3b 0d 09 |Rect(&tR|ect2);..|
|00001850| 09 56 61 6c 69 64 52 65 | 63 74 28 26 74 52 65 63 |.ValidRe|ct(&tRec|
|00001860| 74 29 3b 0d 09 09 74 52 | 65 63 74 32 20 3d 20 28 |t);...tR|ect2 = (|
|00001870| 2a 66 44 6f 63 56 53 63 | 72 6f 6c 6c 29 2d 3e 63 |*fDocVSc|roll)->c|
|00001880| 6f 6e 74 72 6c 52 65 63 | 74 3b 20 56 61 6c 69 64 |ontrlRec|t; Valid|
|00001890| 52 65 63 74 28 26 74 52 | 65 63 74 32 29 3b 0d 09 |Rect(&tR|ect2);..|
|000018a0| 09 74 52 65 63 74 32 20 | 3d 20 28 2a 66 44 6f 63 |.tRect2 |= (*fDoc|
|000018b0| 48 53 63 72 6f 6c 6c 29 | 2d 3e 63 6f 6e 74 72 6c |HScroll)|->contrl|
|000018c0| 52 65 63 74 3b 20 56 61 | 6c 69 64 52 65 63 74 28 |Rect; Va|lidRect(|
|000018d0| 26 74 52 65 63 74 32 29 | 3b 0d 09 20 20 7d 0d 7d |&tRect2)|;.. }.}|
|000018e0| 0d 0d 76 6f 69 64 20 54 | 45 44 6f 63 75 6d 65 6e |..void T|EDocumen|
|000018f0| 74 3a 3a 44 6f 43 6f 6e | 74 65 6e 74 28 45 76 65 |t::DoCon|tent(Eve|
|00001900| 6e 74 52 65 63 6f 72 64 | 2a 20 74 68 65 45 76 65 |ntRecord|* theEve|
|00001910| 6e 74 29 0d 7b 0d 09 50 | 6f 69 6e 74 20 6d 6f 75 |nt).{..P|oint mou|
|00001920| 73 65 3b 0d 09 43 6f 6e | 74 72 6f 6c 48 61 6e 64 |se;..Con|trolHand|
|00001930| 6c 65 20 63 6f 6e 74 72 | 6f 6c 3b 0d 09 73 68 6f |le contr|ol;..sho|
|00001940| 72 74 20 70 61 72 74 2c | 20 76 61 6c 75 65 3b 0d |rt part,| value;.|
|00001950| 09 42 6f 6f 6c 65 61 6e | 20 73 68 69 66 74 44 6f |.Boolean| shiftDo|
|00001960| 77 6e 3b 0d 09 52 65 63 | 74 20 74 65 52 65 63 74 |wn;..Rec|t teRect|
|00001970| 3b 0d 0d 09 53 65 74 50 | 6f 72 74 28 66 44 6f 63 |;...SetP|ort(fDoc|
|00001980| 57 69 6e 64 6f 77 29 3b | 0d 09 6d 6f 75 73 65 20 |Window);|..mouse |
|00001990| 3d 20 74 68 65 45 76 65 | 6e 74 2d 3e 77 68 65 72 |= theEve|nt->wher|
|000019a0| 65 3b 09 09 09 09 09 09 | 09 2f 2f 20 67 65 74 20 |e;......|.// get |
|000019b0| 74 68 65 20 63 6c 69 63 | 6b 20 70 6f 73 69 74 69 |the clic|k positi|
|000019c0| 6f 6e 0d 09 47 6c 6f 62 | 61 6c 54 6f 4c 6f 63 61 |on..Glob|alToLoca|
|000019d0| 6c 28 26 6d 6f 75 73 65 | 29 3b 0d 09 47 65 74 54 |l(&mouse|);..GetT|
|000019e0| 45 52 65 63 74 28 26 74 | 65 52 65 63 74 29 3b 0d |ERect(&t|eRect);.|
|000019f0| 09 69 66 20 28 20 50 74 | 49 6e 52 65 63 74 28 6d |.if ( Pt|InRect(m|
|00001a00| 6f 75 73 65 2c 20 26 74 | 65 52 65 63 74 29 20 29 |ouse, &t|eRect) )|
|00001a10| 0d 09 20 20 7b 0d 09 09 | 2f 2f 20 73 65 65 20 69 |.. {...|// see i|
|00001a20| 66 20 77 65 20 6e 65 65 | 64 20 74 6f 20 65 78 74 |f we nee|d to ext|
|00001a30| 65 6e 64 20 74 68 65 20 | 73 65 6c 65 63 74 69 6f |end the |selectio|
|00001a40| 6e 0d 09 09 73 68 69 66 | 74 44 6f 77 6e 20 3d 20 |n...shif|tDown = |
|00001a50| 28 74 68 65 45 76 65 6e | 74 2d 3e 6d 6f 64 69 66 |(theEven|t->modif|
|00001a60| 69 65 72 73 20 26 20 73 | 68 69 66 74 4b 65 79 29 |iers & s|hiftKey)|
|00001a70| 20 21 3d 20 30 3b 09 2f | 2f 20 65 78 74 65 6e 64 | != 0;./|/ extend|
|00001a80| 20 69 66 20 53 68 69 66 | 74 20 69 73 20 64 6f 77 | if Shif|t is dow|
|00001a90| 6e 0d 09 09 54 45 43 6c | 69 63 6b 28 6d 6f 75 73 |n...TECl|ick(mous|
|00001aa0| 65 2c 20 73 68 69 66 74 | 44 6f 77 6e 2c 20 66 44 |e, shift|Down, fD|
|00001ab0| 6f 63 54 45 29 3b 0d 09 | 20 20 7d 0d 09 65 6c 73 |ocTE);..| }..els|
|00001ac0| 65 0d 09 20 20 7b 0d 09 | 09 70 61 72 74 20 3d 20 |e.. {..|.part = |
|00001ad0| 46 69 6e 64 43 6f 6e 74 | 72 6f 6c 28 6d 6f 75 73 |FindCont|rol(mous|
|00001ae0| 65 2c 20 66 44 6f 63 57 | 69 6e 64 6f 77 2c 20 26 |e, fDocW|indow, &|
|00001af0| 63 6f 6e 74 72 6f 6c 29 | 3b 0d 09 09 73 77 69 74 |control)|;...swit|
|00001b00| 63 68 20 28 20 70 61 72 | 74 20 29 0d 09 09 20 20 |ch ( par|t )... |
|00001b10| 7b 0d 09 09 09 63 61 73 | 65 20 30 3a 0d 09 09 09 |{....cas|e 0:....|
|00001b20| 09 2f 2f 20 64 6f 20 6e | 6f 74 68 69 6e 67 20 69 |.// do n|othing i|
|00001b30| 66 20 6e 6f 74 20 69 6e | 20 61 20 63 6f 6e 74 72 |f not in| a contr|
|00001b40| 6f 6c 0d 09 09 09 09 62 | 72 65 61 6b 3b 0d 09 09 |ol.....b|reak;...|
|00001b50| 09 63 61 73 65 20 69 6e | 54 68 75 6d 62 3a 0d 09 |.case in|Thumb:..|
|00001b60| 09 09 09 76 61 6c 75 65 | 20 3d 20 47 65 74 43 74 |...value| = GetCt|
|00001b70| 6c 56 61 6c 75 65 28 63 | 6f 6e 74 72 6f 6c 29 3b |lValue(c|ontrol);|
|00001b80| 0d 09 09 09 09 70 61 72 | 74 20 3d 20 54 72 61 63 |.....par|t = Trac|
|00001b90| 6b 43 6f 6e 74 72 6f 6c | 28 63 6f 6e 74 72 6f 6c |kControl|(control|
|00001ba0| 2c 20 6d 6f 75 73 65 2c | 20 6e 69 6c 29 3b 0d 09 |, mouse,| nil);..|
|00001bb0| 09 09 09 69 66 20 28 20 | 70 61 72 74 20 21 3d 20 |...if ( |part != |
|00001bc0| 30 20 29 0d 09 09 09 09 | 20 20 7b 0d 09 09 09 09 |0 ).....| {.....|
|00001bd0| 09 76 61 6c 75 65 20 2d | 3d 20 47 65 74 43 74 6c |.value -|= GetCtl|
|00001be0| 56 61 6c 75 65 28 63 6f | 6e 74 72 6f 6c 29 3b 0d |Value(co|ntrol);.|
|00001bf0| 09 09 09 09 09 2f 2f 20 | 76 61 6c 75 65 20 6e 6f |.....// |value no|
|00001c00| 77 20 68 61 73 20 43 48 | 41 4e 47 45 20 69 6e 20 |w has CH|ANGE in |
|00001c10| 76 61 6c 75 65 3b 20 69 | 66 20 76 61 6c 75 65 20 |value; i|f value |
|00001c20| 63 68 61 6e 67 65 64 2c | 20 73 63 72 6f 6c 6c 0d |changed,| scroll.|
|00001c30| 09 09 09 09 09 69 66 20 | 28 20 76 61 6c 75 65 20 |.....if |( value |
|00001c40| 21 3d 20 30 20 29 0d 09 | 09 09 09 09 09 69 66 20 |!= 0 )..|.....if |
|00001c50| 28 20 63 6f 6e 74 72 6f | 6c 20 3d 3d 20 66 44 6f |( contro|l == fDo|
|00001c60| 63 56 53 63 72 6f 6c 6c | 20 29 0d 09 09 09 09 09 |cVScroll| )......|
|00001c70| 09 09 54 45 53 63 72 6f | 6c 6c 28 30 2c 20 76 61 |..TEScro|ll(0, va|
|00001c80| 6c 75 65 20 2a 20 28 2a | 66 44 6f 63 54 45 29 2d |lue * (*|fDocTE)-|
|00001c90| 3e 6c 69 6e 65 48 65 69 | 67 68 74 2c 20 66 44 6f |>lineHei|ght, fDo|
|00001ca0| 63 54 45 29 3b 0d 09 09 | 09 09 09 09 65 6c 73 65 |cTE);...|....else|
|00001cb0| 20 54 45 53 63 72 6f 6c | 6c 28 76 61 6c 75 65 2c | TEScrol|l(value,|
|00001cc0| 20 30 2c 20 66 44 6f 63 | 54 45 29 3b 0d 09 09 09 | 0, fDoc|TE);....|
|00001cd0| 09 20 20 7d 0d 09 09 09 | 09 62 72 65 61 6b 3b 0d |. }....|.break;.|
|00001ce0| 09 09 09 64 65 66 61 75 | 6c 74 3a 09 09 09 09 09 |...defau|lt:.....|
|00001cf0| 09 2f 2f 20 74 68 65 79 | 20 63 6c 69 63 6b 65 64 |.// they| clicked|
|00001d00| 20 69 6e 20 61 6e 20 61 | 72 72 6f 77 2c 20 73 6f | in an a|rrow, so|
|00001d10| 20 74 72 61 63 6b 20 26 | 20 73 63 72 6f 6c 6c 0d | track &| scroll.|
|00001d20| 09 09 09 09 69 66 20 28 | 20 63 6f 6e 74 72 6f 6c |....if (| control|
|00001d30| 20 3d 3d 20 66 44 6f 63 | 56 53 63 72 6f 6c 6c 20 | == fDoc|VScroll |
|00001d40| 29 0d 09 09 09 09 09 76 | 61 6c 75 65 20 3d 20 54 |)......v|alue = T|
|00001d50| 72 61 63 6b 43 6f 6e 74 | 72 6f 6c 28 63 6f 6e 74 |rackCont|rol(cont|
|00001d60| 72 6f 6c 2c 20 6d 6f 75 | 73 65 2c 20 28 50 72 6f |rol, mou|se, (Pro|
|00001d70| 63 50 74 72 29 20 56 41 | 63 74 69 6f 6e 50 72 6f |cPtr) VA|ctionPro|
|00001d80| 63 29 3b 0d 09 09 09 09 | 65 6c 73 65 20 76 61 6c |c);.....|else val|
|00001d90| 75 65 20 3d 20 54 72 61 | 63 6b 43 6f 6e 74 72 6f |ue = Tra|ckContro|
|00001da0| 6c 28 63 6f 6e 74 72 6f | 6c 2c 20 6d 6f 75 73 65 |l(contro|l, mouse|
|00001db0| 2c 20 28 50 72 6f 63 50 | 74 72 29 20 48 41 63 74 |, (ProcP|tr) HAct|
|00001dc0| 69 6f 6e 50 72 6f 63 29 | 3b 0d 09 09 09 09 62 72 |ionProc)|;.....br|
|00001dd0| 65 61 6b 3b 0d 09 09 20 | 20 7d 0d 09 20 20 7d 0d |eak;... | }.. }.|
|00001de0| 7d 0d 0d 76 6f 69 64 20 | 54 45 44 6f 63 75 6d 65 |}..void |TEDocume|
|00001df0| 6e 74 3a 3a 44 6f 4b 65 | 79 44 6f 77 6e 28 45 76 |nt::DoKe|yDown(Ev|
|00001e00| 65 6e 74 52 65 63 6f 72 | 64 2a 20 74 68 65 45 76 |entRecor|d* theEv|
|00001e10| 65 6e 74 29 0d 7b 0d 09 | 63 68 61 72 20 6b 65 79 |ent).{..|char key|
|00001e20| 3b 0d 0d 09 69 66 20 28 | 74 68 65 45 76 65 6e 74 |;...if (|theEvent|
|00001e30| 2d 3e 6d 6f 64 69 66 69 | 65 72 73 20 26 20 63 6d |->modifi|ers & cm|
|00001e40| 64 4b 65 79 29 09 2f 2f | 20 64 6f 6e 27 74 20 70 |dKey).//| don't p|
|00001e50| 72 6f 63 65 73 73 20 63 | 6f 6d 6d 61 6e 64 20 63 |rocess c|ommand c|
|00001e60| 68 61 72 61 63 74 65 72 | 73 0d 09 20 20 72 65 74 |haracter|s.. ret|
|00001e70| 75 72 6e 3b 0d 09 6b 65 | 79 20 3d 20 28 63 68 61 |urn;..ke|y = (cha|
|00001e80| 72 29 20 28 74 68 65 45 | 76 65 6e 74 2d 3e 6d 65 |r) (theE|vent->me|
|00001e90| 73 73 61 67 65 20 26 20 | 63 68 61 72 43 6f 64 65 |ssage & |charCode|
|00001ea0| 4d 61 73 6b 29 3b 0d 09 | 2f 2f 20 77 65 20 68 61 |Mask);..|// we ha|
|00001eb0| 76 65 20 61 20 63 68 61 | 72 2e 20 66 6f 72 20 6f |ve a cha|r. for o|
|00001ec0| 75 72 20 77 69 6e 64 6f | 77 3b 20 73 65 65 20 69 |ur windo|w; see i|
|00001ed0| 66 20 77 65 20 61 72 65 | 20 73 74 69 6c 6c 20 62 |f we are| still b|
|00001ee0| 65 6c 6f 77 20 54 65 78 | 74 45 64 69 74 d5 73 0d |elow Tex|tEdit.s.|
|00001ef0| 09 2f 2f 20 6c 69 6d 69 | 74 20 66 6f 72 20 74 68 |.// limi|t for th|
|00001f00| 65 20 6e 75 6d 62 65 72 | 20 6f 66 20 63 68 61 72 |e number| of char|
|00001f10| 61 63 74 65 72 73 0d 09 | 69 66 20 28 28 6b 65 79 |acters..|if ((key|
|00001f20| 20 21 3d 20 6b 44 65 6c | 43 68 61 72 29 20 26 26 | != kDel|Char) &&|
|00001f30| 0d 09 09 28 28 2a 66 44 | 6f 63 54 45 29 2d 3e 74 |...((*fD|ocTE)->t|
|00001f40| 65 4c 65 6e 67 74 68 20 | 2d 20 28 28 2a 66 44 6f |eLength |- ((*fDo|
|00001f50| 63 54 45 29 2d 3e 73 65 | 6c 45 6e 64 20 2d 20 28 |cTE)->se|lEnd - (|
|00001f60| 2a 66 44 6f 63 54 45 29 | 2d 3e 73 65 6c 53 74 61 |*fDocTE)|->selSta|
|00001f70| 72 74 29 20 2b 20 31 20 | 3e 3d 20 6b 4d 61 78 54 |rt) + 1 |>= kMaxT|
|00001f80| 45 4c 65 6e 67 74 68 29 | 20 29 0d 09 20 20 46 61 |ELength)| ).. Fa|
|00001f90| 69 6c 75 72 65 28 65 45 | 78 63 65 65 64 43 68 61 |ilure(eE|xceedCha|
|00001fa0| 72 2c 6b 54 45 44 6f 63 | 45 72 72 53 74 72 69 6e |r,kTEDoc|ErrStrin|
|00001fb0| 67 73 29 3b 0d 0d 09 54 | 45 4b 65 79 28 6b 65 79 |gs);...T|EKey(key|
|00001fc0| 2c 20 66 44 6f 63 54 45 | 29 3b 0d 09 41 64 6a 75 |, fDocTE|);..Adju|
|00001fd0| 73 74 53 63 72 6f 6c 6c | 62 61 72 73 28 66 61 6c |stScroll|bars(fal|
|00001fe0| 73 65 29 3b 0d 09 41 64 | 6a 75 73 74 54 45 28 29 |se);..Ad|justTE()|
|00001ff0| 3b 0d 09 66 44 69 72 74 | 79 20 3d 20 74 72 75 65 |;..fDirt|y = true|
|00002000| 3b 0d 7d 0d 0d 76 6f 69 | 64 20 54 45 44 6f 63 75 |;.}..voi|d TEDocu|
|00002010| 6d 65 6e 74 3a 3a 44 6f | 41 63 74 69 76 61 74 65 |ment::Do|Activate|
|00002020| 28 42 6f 6f 6c 65 61 6e | 20 62 65 63 6f 6d 69 6e |(Boolean| becomin|
|00002030| 67 41 63 74 69 76 65 29 | 0d 7b 0d 09 69 66 20 28 |gActive)|.{..if (|
|00002040| 20 62 65 63 6f 6d 69 6e | 67 41 63 74 69 76 65 20 | becomin|gActive |
|00002050| 29 0d 09 20 20 7b 0d 09 | 09 52 67 6e 48 61 6e 64 |).. {..|.RgnHand|
|00002060| 6c 65 09 74 65 6d 70 52 | 67 6e 3b 0d 09 09 52 67 |le.tempR|gn;...Rg|
|00002070| 6e 48 61 6e 64 6c 65 09 | 63 6c 69 70 52 67 6e 3b |nHandle.|clipRgn;|
|00002080| 0d 09 09 52 65 63 74 09 | 09 67 72 6f 77 52 65 63 |...Rect.|.growRec|
|00002090| 74 3b 0d 09 09 52 65 63 | 74 09 09 74 52 65 63 74 |t;...Rec|t..tRect|
|000020a0| 3b 0d 0d 09 09 2f 2f 20 | 73 69 6e 63 65 20 77 65 |;....// |since we|
|000020b0| 20 64 6f 6e d5 74 20 77 | 61 6e 74 20 54 45 41 63 | don.t w|ant TEAc|
|000020c0| 74 69 76 61 74 65 20 74 | 6f 20 64 72 61 77 20 61 |tivate t|o draw a|
|000020d0| 20 73 65 6c 65 63 74 69 | 6f 6e 20 69 6e 20 61 6e | selecti|on in an|
|000020e0| 20 61 72 65 61 20 77 68 | 65 72 65 0d 09 09 2f 2f | area wh|ere...//|
|000020f0| 20 77 65 d5 72 65 20 67 | 6f 69 6e 67 20 74 6f 20 | we.re g|oing to |
|00002100| 65 72 61 73 65 20 61 6e | 64 20 72 65 64 72 61 77 |erase an|d redraw|
|00002110| 2c 20 77 65 d5 6c 6c 20 | 63 6c 69 70 20 6f 75 74 |, we.ll |clip out|
|00002120| 20 74 68 65 20 75 70 64 | 61 74 65 20 72 65 67 69 | the upd|ate regi|
|00002130| 6f 6e 0d 09 09 2f 2f 20 | 62 65 66 6f 72 65 20 63 |on...// |before c|
|00002140| 61 6c 6c 69 6e 67 20 69 | 74 2e 0d 09 09 74 65 6d |alling i|t....tem|
|00002150| 70 52 67 6e 20 3d 20 4e | 65 77 52 67 6e 28 29 3b |pRgn = N|ewRgn();|
|00002160| 0d 09 09 63 6c 69 70 52 | 67 6e 20 3d 20 4e 65 77 |...clipR|gn = New|
|00002170| 52 67 6e 28 29 3b 0d 09 | 09 2f 2f 20 73 61 76 65 |Rgn();..|.// save|
|00002180| 20 6f 6c 64 20 75 70 64 | 61 74 65 20 72 65 67 69 | old upd|ate regi|
|00002190| 6f 6e 0d 09 09 43 6f 70 | 79 52 67 6e 28 28 28 57 |on...Cop|yRgn(((W|
|000021a0| 69 6e 64 6f 77 50 65 65 | 6b 29 20 66 44 6f 63 57 |indowPee|k) fDocW|
|000021b0| 69 6e 64 6f 77 29 2d 3e | 75 70 64 61 74 65 52 67 |indow)->|updateRg|
|000021c0| 6e 2c 20 74 65 6d 70 52 | 67 6e 29 3b 0d 09 09 2f |n, tempR|gn);.../|
|000021d0| 2f 20 70 75 74 20 69 74 | 20 69 6e 20 6c 6f 63 61 |/ put it| in loca|
|000021e0| 6c 20 63 6f 6f 72 64 73 | 0d 09 09 4f 66 66 73 65 |l coords|...Offse|
|000021f0| 74 52 67 6e 28 74 65 6d | 70 52 67 6e 2c 20 66 44 |tRgn(tem|pRgn, fD|
|00002200| 6f 63 57 69 6e 64 6f 77 | 2d 3e 70 6f 72 74 42 69 |ocWindow|->portBi|
|00002210| 74 73 2e 62 6f 75 6e 64 | 73 2e 6c 65 66 74 2c 20 |ts.bound|s.left, |
|00002220| 66 44 6f 63 57 69 6e 64 | 6f 77 2d 3e 70 6f 72 74 |fDocWind|ow->port|
|00002230| 42 69 74 73 2e 62 6f 75 | 6e 64 73 2e 74 6f 70 29 |Bits.bou|nds.top)|
|00002240| 3b 0d 09 09 47 65 74 43 | 6c 69 70 28 63 6c 69 70 |;...GetC|lip(clip|
|00002250| 52 67 6e 29 3b 0d 09 09 | 2f 2f 20 73 75 62 74 72 |Rgn);...|// subtr|
|00002260| 61 63 74 20 75 70 64 61 | 74 65 52 67 6e 20 66 72 |act upda|teRgn fr|
|00002270| 6f 6d 20 63 6c 69 70 52 | 67 6e 0d 09 09 44 69 66 |om clipR|gn...Dif|
|00002280| 66 52 67 6e 28 63 6c 69 | 70 52 67 6e 2c 20 74 65 |fRgn(cli|pRgn, te|
|00002290| 6d 70 52 67 6e 2c 20 74 | 65 6d 70 52 67 6e 29 3b |mpRgn, t|empRgn);|
|000022a0| 0d 09 09 2f 2f 20 6d 61 | 6b 65 20 69 74 20 74 68 |...// ma|ke it th|
|000022b0| 65 20 6e 65 77 20 63 6c | 69 70 52 67 6e 0d 09 09 |e new cl|ipRgn...|
|000022c0| 53 65 74 43 6c 69 70 28 | 74 65 6d 70 52 67 6e 29 |SetClip(|tempRgn)|
|000022d0| 3b 0d 09 09 54 45 41 63 | 74 69 76 61 74 65 28 66 |;...TEAc|tivate(f|
|000022e0| 44 6f 63 54 45 29 3b 0d | 09 09 2f 2f 20 72 65 73 |DocTE);.|..// res|
|000022f0| 74 6f 72 65 20 74 68 65 | 20 66 75 6c 6c 2d 62 6c |tore the| full-bl|
|00002300| 6f 77 6e 20 63 6c 69 70 | 52 67 6e 0d 09 09 53 65 |own clip|Rgn...Se|
|00002310| 74 43 6c 69 70 28 63 6c | 69 70 52 67 6e 29 3b 0d |tClip(cl|ipRgn);.|
|00002320| 09 09 2f 2f 20 67 65 74 | 20 72 69 64 20 6f 66 20 |..// get| rid of |
|00002330| 74 65 6d 70 20 72 65 67 | 69 6f 6e 73 0d 09 09 44 |temp reg|ions...D|
|00002340| 69 73 70 6f 73 65 52 67 | 6e 28 74 65 6d 70 52 67 |isposeRg|n(tempRg|
|00002350| 6e 29 3b 0d 09 09 44 69 | 73 70 6f 73 65 52 67 6e |n);...Di|sposeRgn|
|00002360| 28 63 6c 69 70 52 67 6e | 29 3b 0d 0d 09 09 2f 2f |(clipRgn|);....//|
|00002370| 20 74 68 65 20 63 6f 6e | 74 72 6f 6c 73 20 6d 75 | the con|trols mu|
|00002380| 73 74 20 62 65 20 72 65 | 64 72 61 77 6e 20 6f 6e |st be re|drawn on|
|00002390| 20 61 63 74 69 76 61 74 | 69 6f 6e 3a 0d 09 09 28 | activat|ion:...(|
|000023a0| 2a 66 44 6f 63 56 53 63 | 72 6f 6c 6c 29 2d 3e 63 |*fDocVSc|roll)->c|
|000023b0| 6f 6e 74 72 6c 56 69 73 | 20 3d 20 6b 43 6f 6e 74 |ontrlVis| = kCont|
|000023c0| 72 6f 6c 56 69 73 69 62 | 6c 65 3b 0d 09 09 28 2a |rolVisib|le;...(*|
|000023d0| 66 44 6f 63 48 53 63 72 | 6f 6c 6c 29 2d 3e 63 6f |fDocHScr|oll)->co|
|000023e0| 6e 74 72 6c 56 69 73 20 | 3d 20 6b 43 6f 6e 74 72 |ntrlVis |= kContr|
|000023f0| 6f 6c 56 69 73 69 62 6c | 65 3b 0d 09 09 2f 2f 20 |olVisibl|e;...// |
|00002400| 63 6f 70 79 20 72 65 63 | 74 61 6e 67 6c 65 73 20 |copy rec|tangles |
|00002410| 74 6f 20 61 76 6f 69 64 | 20 75 6e 73 61 66 65 20 |to avoid| unsafe |
|00002420| 6f 62 6a 65 63 74 20 66 | 69 65 6c 64 20 72 65 66 |object f|ield ref|
|00002430| 65 72 65 6e 63 65 73 21 | 0d 09 09 74 52 65 63 74 |erences!|...tRect|
|00002440| 20 3d 20 28 2a 66 44 6f | 63 56 53 63 72 6f 6c 6c | = (*fDo|cVScroll|
|00002450| 29 2d 3e 63 6f 6e 74 72 | 6c 52 65 63 74 3b 20 49 |)->contr|lRect; I|
|00002460| 6e 76 61 6c 52 65 63 74 | 28 26 74 52 65 63 74 29 |nvalRect|(&tRect)|
|00002470| 3b 0d 09 09 74 52 65 63 | 74 20 3d 20 28 2a 66 44 |;...tRec|t = (*fD|
|00002480| 6f 63 48 53 63 72 6f 6c | 6c 29 2d 3e 63 6f 6e 74 |ocHScrol|l)->cont|
|00002490| 72 6c 52 65 63 74 3b 20 | 49 6e 76 61 6c 52 65 63 |rlRect; |InvalRec|
|000024a0| 74 28 26 74 52 65 63 74 | 29 3b 0d 09 09 2f 2f 20 |t(&tRect|);...// |
|000024b0| 74 68 65 20 67 72 6f 77 | 62 6f 78 20 6e 65 65 64 |the grow|box need|
|000024c0| 73 20 74 6f 20 62 65 20 | 72 65 64 72 61 77 6e 20 |s to be |redrawn |
|000024d0| 6f 6e 20 61 63 74 69 76 | 61 74 69 6f 6e 3a 0d 09 |on activ|ation:..|
|000024e0| 09 67 72 6f 77 52 65 63 | 74 20 3d 20 66 44 6f 63 |.growRec|t = fDoc|
|000024f0| 57 69 6e 64 6f 77 2d 3e | 70 6f 72 74 52 65 63 74 |Window->|portRect|
|00002500| 3b 0d 09 09 2f 2f 20 61 | 64 6a 75 73 74 20 66 6f |;...// a|djust fo|
|00002510| 72 20 74 68 65 20 73 63 | 72 6f 6c 6c 62 61 72 73 |r the sc|rollbars|
|00002520| 0d 09 09 67 72 6f 77 52 | 65 63 74 2e 74 6f 70 20 |...growR|ect.top |
|00002530| 3d 20 67 72 6f 77 52 65 | 63 74 2e 62 6f 74 74 6f |= growRe|ct.botto|
|00002540| 6d 20 2d 20 6b 53 63 72 | 6f 6c 6c 62 61 72 41 64 |m - kScr|ollbarAd|
|00002550| 6a 75 73 74 3b 0d 09 09 | 67 72 6f 77 52 65 63 74 |just;...|growRect|
|00002560| 2e 6c 65 66 74 20 3d 20 | 67 72 6f 77 52 65 63 74 |.left = |growRect|
|00002570| 2e 72 69 67 68 74 20 2d | 20 6b 53 63 72 6f 6c 6c |.right -| kScroll|
|00002580| 62 61 72 41 64 6a 75 73 | 74 3b 0d 09 09 49 6e 76 |barAdjus|t;...Inv|
|00002590| 61 6c 52 65 63 74 28 26 | 67 72 6f 77 52 65 63 74 |alRect(&|growRect|
|000025a0| 29 3b 0d 09 20 20 7d 0d | 09 65 6c 73 65 0d 09 20 |);.. }.|.else.. |
|000025b0| 20 7b 0d 09 09 54 45 44 | 65 61 63 74 69 76 61 74 | {...TED|eactivat|
|000025c0| 65 28 66 44 6f 63 54 45 | 29 3b 0d 09 09 2f 2f 20 |e(fDocTE|);...// |
|000025d0| 74 68 65 20 63 6f 6e 74 | 72 6f 6c 73 20 6d 75 73 |the cont|rols mus|
|000025e0| 74 20 62 65 20 68 69 64 | 64 65 6e 20 6f 6e 20 64 |t be hid|den on d|
|000025f0| 65 61 63 74 69 76 61 74 | 69 6f 6e 3a 0d 09 09 48 |eactivat|ion:...H|
|00002600| 69 64 65 43 6f 6e 74 72 | 6f 6c 28 66 44 6f 63 56 |ideContr|ol(fDocV|
|00002610| 53 63 72 6f 6c 6c 29 3b | 0d 09 09 48 69 64 65 43 |Scroll);|...HideC|
|00002620| 6f 6e 74 72 6f 6c 28 66 | 44 6f 63 48 53 63 72 6f |ontrol(f|DocHScro|
|00002630| 6c 6c 29 3b 0d 09 09 2f | 2f 20 77 65 20 64 72 61 |ll);.../|/ we dra|
|00002640| 77 20 67 72 6f 77 20 69 | 63 6f 6e 20 69 6d 6d 65 |w grow i|con imme|
|00002650| 64 69 61 74 65 6c 79 2c | 20 73 69 6e 63 65 20 77 |diately,| since w|
|00002660| 65 20 64 65 61 63 74 69 | 76 61 74 65 20 63 6f 6e |e deacti|vate con|
|00002670| 74 72 6f 6c 73 0d 09 09 | 2f 2f 20 69 6d 6d 65 64 |trols...|// immed|
|00002680| 69 61 74 65 6c 79 2c 20 | 61 6e 64 20 74 68 65 20 |iately, |and the |
|00002690| 75 70 64 61 74 65 20 64 | 65 6c 61 79 20 6c 6f 6f |update d|elay loo|
|000026a0| 6b 73 20 66 75 6e 6e 79 | 0d 09 09 44 72 61 77 47 |ks funny|...DrawG|
|000026b0| 72 6f 77 49 63 6f 6e 28 | 66 44 6f 63 57 69 6e 64 |rowIcon(|fDocWind|
|000026c0| 6f 77 29 3b 0d 09 20 20 | 7d 0d 7d 0d 0d 76 6f 69 |ow);.. |}.}..voi|
|000026d0| 64 20 54 45 44 6f 63 75 | 6d 65 6e 74 3a 3a 44 6f |d TEDocu|ment::Do|
|000026e0| 55 70 64 61 74 65 28 29 | 0d 7b 0d 09 42 65 67 69 |Update()|.{..Begi|
|000026f0| 6e 55 70 64 61 74 65 28 | 66 44 6f 63 57 69 6e 64 |nUpdate(|fDocWind|
|00002700| 6f 77 29 3b 09 09 09 09 | 2f 2f 20 74 68 69 73 20 |ow);....|// this |
|00002710| 73 65 74 73 20 75 70 20 | 74 68 65 20 76 69 73 52 |sets up |the visR|
|00002720| 67 6e 0d 09 69 66 20 28 | 20 21 20 45 6d 70 74 79 |gn..if (| ! Empty|
|00002730| 52 67 6e 28 66 44 6f 63 | 57 69 6e 64 6f 77 2d 3e |Rgn(fDoc|Window->|
|00002740| 76 69 73 52 67 6e 29 20 | 29 09 2f 2f 20 64 72 61 |visRgn) |).// dra|
|00002750| 77 20 69 66 20 75 70 64 | 61 74 69 6e 67 20 6e 65 |w if upd|ating ne|
|00002760| 65 64 73 20 74 6f 20 62 | 65 20 64 6f 6e 65 0d 09 |eds to b|e done..|
|00002770| 20 20 7b 0d 09 09 44 72 | 61 77 57 69 6e 64 6f 77 | {...Dr|awWindow|
|00002780| 28 29 3b 0d 09 20 20 7d | 0d 09 45 6e 64 55 70 64 |();.. }|..EndUpd|
|00002790| 61 74 65 28 66 44 6f 63 | 57 69 6e 64 6f 77 29 3b |ate(fDoc|Window);|
|000027a0| 0d 7d 0d 0d 2f 2f 20 63 | 61 6c 63 75 6c 61 74 65 |.}..// c|alculate|
|000027b0| 20 68 6f 77 20 6d 75 63 | 68 20 69 64 6c 65 20 74 | how muc|h idle t|
|000027c0| 69 6d 65 20 77 65 20 6e | 65 65 64 0d 0d 75 6e 73 |ime we n|eed..uns|
|000027d0| 69 67 6e 65 64 20 6c 6f | 6e 67 20 54 45 44 6f 63 |igned lo|ng TEDoc|
|000027e0| 75 6d 65 6e 74 3a 3a 43 | 61 6c 63 49 64 6c 65 28 |ument::C|alcIdle(|
|000027f0| 29 0d 7b 0d 09 69 66 20 | 28 48 61 76 65 53 65 6c |).{..if |(HaveSel|
|00002800| 65 63 74 69 6f 6e 28 29 | 29 0d 09 20 20 72 65 74 |ection()|).. ret|
|00002810| 75 72 6e 20 47 65 74 43 | 61 72 65 74 54 69 6d 65 |urn GetC|aretTime|
|00002820| 28 29 3b 0d 09 65 6c 73 | 65 20 72 65 74 75 72 6e |();..els|e return|
|00002830| 20 6b 4d 61 78 53 6c 65 | 65 70 54 69 6d 65 3b 09 | kMaxSle|epTime;.|
|00002840| 2f 2f 20 69 66 20 77 65 | 20 64 6f 6e 27 74 20 68 |// if we| don't h|
|00002850| 61 76 65 20 61 20 73 65 | 6c 65 63 74 69 6f 6e 2c |ave a se|lection,|
|00002860| 20 77 65 20 64 6f 6e 27 | 74 20 6e 65 65 64 20 74 | we don'|t need t|
|00002870| 6f 20 69 64 6c 65 0d 7d | 0d 0d 2f 2f 20 54 68 69 |o idle.}|..// Thi|
|00002880| 73 20 69 73 20 63 61 6c | 6c 65 64 20 77 68 65 6e |s is cal|led when|
|00002890| 65 76 65 72 20 77 65 20 | 67 65 74 20 61 20 6e 75 |ever we |get a nu|
|000028a0| 6c 6c 20 65 76 65 6e 74 | 20 65 74 20 61 6c 2e 0d |ll event| et al..|
|000028b0| 2f 2f 20 49 74 20 74 61 | 6b 65 73 20 63 61 72 65 |// It ta|kes care|
|000028c0| 20 6f 66 20 6e 65 63 65 | 73 73 61 72 79 20 70 65 | of nece|ssary pe|
|000028d0| 72 69 6f 64 69 63 20 61 | 63 74 69 6f 6e 73 2e 20 |riodic a|ctions. |
|000028e0| 46 6f 72 20 74 68 69 73 | 20 70 72 6f 67 72 61 6d |For this| program|
|000028f0| 2c 0d 2f 2f 20 69 74 20 | 63 61 6c 6c 73 20 54 45 |,.// it |calls TE|
|00002900| 49 64 6c 65 2e 0d 0d 76 | 6f 69 64 20 54 45 44 6f |Idle...v|oid TEDo|
|00002910| 63 75 6d 65 6e 74 3a 3a | 44 6f 49 64 6c 65 28 29 |cument::|DoIdle()|
|00002920| 0d 7b 0d 09 54 45 49 64 | 6c 65 28 66 44 6f 63 54 |.{..TEId|le(fDocT|
|00002930| 45 29 3b 0d 7d 20 2f 2f | 20 44 6f 49 64 6c 65 0d |E);.} //| DoIdle.|
|00002940| 0d 2f 2f 20 44 72 61 77 | 20 74 68 65 20 63 6f 6e |.// Draw| the con|
|00002950| 74 65 6e 74 73 20 6f 66 | 20 61 6e 20 61 70 70 6c |tents of| an appl|
|00002960| 69 63 61 74 69 6f 6e 20 | 77 69 6e 64 6f 77 2e 0d |ication |window..|
|00002970| 0d 76 6f 69 64 20 54 45 | 44 6f 63 75 6d 65 6e 74 |.void TE|Document|
|00002980| 3a 3a 44 72 61 77 57 69 | 6e 64 6f 77 28 29 0d 7b |::DrawWi|ndow().{|
|00002990| 0d 09 52 65 63 74 20 74 | 52 65 63 74 3b 0d 0d 09 |..Rect t|Rect;...|
|000029a0| 53 65 74 50 6f 72 74 28 | 66 44 6f 63 57 69 6e 64 |SetPort(|fDocWind|
|000029b0| 6f 77 29 3b 0d 09 74 52 | 65 63 74 20 3d 20 66 44 |ow);..tR|ect = fD|
|000029c0| 6f 63 57 69 6e 64 6f 77 | 2d 3e 70 6f 72 74 52 65 |ocWindow|->portRe|
|000029d0| 63 74 3b 0d 09 45 72 61 | 73 65 52 65 63 74 28 26 |ct;..Era|seRect(&|
|000029e0| 74 52 65 63 74 29 3b 0d | 09 54 45 55 70 64 61 74 |tRect);.|.TEUpdat|
|000029f0| 65 28 26 74 52 65 63 74 | 2c 20 66 44 6f 63 54 45 |e(&tRect|, fDocTE|
|00002a00| 29 3b 0d 09 44 72 61 77 | 43 6f 6e 74 72 6f 6c 73 |);..Draw|Controls|
|00002a10| 28 66 44 6f 63 57 69 6e | 64 6f 77 29 3b 0d 09 44 |(fDocWin|dow);..D|
|00002a20| 72 61 77 47 72 6f 77 49 | 63 6f 6e 28 66 44 6f 63 |rawGrowI|con(fDoc|
|00002a30| 57 69 6e 64 6f 77 29 3b | 0d 7d 20 2f 2f 20 44 72 |Window);|.} // Dr|
|00002a40| 61 77 57 69 6e 64 6f 77 | 0d 0d 2f 2f 20 52 65 74 |awWindow|..// Ret|
|00002a50| 75 72 6e 20 61 20 72 65 | 63 74 61 6e 67 6c 65 20 |urn a re|ctangle |
|00002a60| 74 68 61 74 20 69 73 20 | 69 6e 73 65 74 20 66 72 |that is |inset fr|
|00002a70| 6f 6d 20 74 68 65 20 70 | 6f 72 74 52 65 63 74 20 |om the p|ortRect |
|00002a80| 62 79 20 74 68 65 20 73 | 69 7a 65 20 6f 66 0d 2f |by the s|ize of./|
|00002a90| 2f 20 74 68 65 20 73 63 | 72 6f 6c 6c 62 61 72 73 |/ the sc|rollbars|
|00002aa0| 20 61 6e 64 20 61 20 6c | 69 74 74 6c 65 20 65 78 | and a l|ittle ex|
|00002ab0| 74 72 61 20 6d 61 72 67 | 69 6e 2e 0d 0d 76 6f 69 |tra marg|in...voi|
|00002ac0| 64 20 54 45 44 6f 63 75 | 6d 65 6e 74 3a 3a 47 65 |d TEDocu|ment::Ge|
|00002ad0| 74 54 45 52 65 63 74 28 | 52 65 63 74 2a 20 74 65 |tTERect(|Rect* te|
|00002ae0| 52 65 63 74 29 0d 7b 0d | 09 2a 74 65 52 65 63 74 |Rect).{.|.*teRect|
|00002af0| 20 3d 20 66 44 6f 63 57 | 69 6e 64 6f 77 2d 3e 70 | = fDocW|indow->p|
|00002b00| 6f 72 74 52 65 63 74 3b | 0d 09 49 6e 73 65 74 52 |ortRect;|..InsetR|
|00002b10| 65 63 74 28 74 65 52 65 | 63 74 2c 20 6b 54 65 78 |ect(teRe|ct, kTex|
|00002b20| 74 4d 61 72 67 69 6e 2c | 20 6b 54 65 78 74 4d 61 |tMargin,| kTextMa|
|00002b30| 72 67 69 6e 29 3b 09 09 | 09 2f 2f 20 61 64 6a 75 |rgin);..|.// adju|
|00002b40| 73 74 20 66 6f 72 20 6d | 61 72 67 69 6e 0d 09 74 |st for m|argin..t|
|00002b50| 65 52 65 63 74 2d 3e 62 | 6f 74 74 6f 6d 20 3d 20 |eRect->b|ottom = |
|00002b60| 74 65 52 65 63 74 2d 3e | 62 6f 74 74 6f 6d 20 2d |teRect->|bottom -|
|00002b70| 20 6b 53 63 72 6f 6c 6c | 62 61 72 41 64 6a 75 73 | kScroll|barAdjus|
|00002b80| 74 3b 09 2f 2f 20 61 6e | 64 20 66 6f 72 20 74 68 |t;.// an|d for th|
|00002b90| 65 20 73 63 72 6f 6c 6c | 62 61 72 73 0d 09 74 65 |e scroll|bars..te|
|00002ba0| 52 65 63 74 2d 3e 72 69 | 67 68 74 20 3d 20 74 65 |Rect->ri|ght = te|
|00002bb0| 52 65 63 74 2d 3e 72 69 | 67 68 74 20 2d 20 6b 53 |Rect->ri|ght - kS|
|00002bc0| 63 72 6f 6c 6c 62 61 72 | 41 64 6a 75 73 74 3b 0d |crollbar|Adjust;.|
|00002bd0| 7d 20 2f 2f 20 47 65 74 | 54 45 52 65 63 74 0d 0d |} // Get|TERect..|
|00002be0| 2f 2f 20 73 65 74 75 70 | 20 61 20 72 65 67 69 6f |// setup| a regio|
|00002bf0| 6e 20 77 68 69 63 68 20 | 63 6f 6e 74 61 69 6e 73 |n which |contains|
|00002c00| 20 74 68 65 20 76 69 73 | 69 62 6c 65 20 74 65 78 | the vis|ible tex|
|00002c10| 74 0d 0d 76 6f 69 64 20 | 54 45 44 6f 63 75 6d 65 |t..void |TEDocume|
|00002c20| 6e 74 3a 3a 47 65 74 56 | 69 73 54 45 52 67 6e 28 |nt::GetV|isTERgn(|
|00002c30| 52 67 6e 48 61 6e 64 6c | 65 20 72 67 6e 29 0d 7b |RgnHandl|e rgn).{|
|00002c40| 0d 09 52 65 63 74 20 74 | 65 52 65 63 74 3b 0d 0d |..Rect t|eRect;..|
|00002c50| 09 74 65 52 65 63 74 20 | 3d 20 28 2a 66 44 6f 63 |.teRect |= (*fDoc|
|00002c60| 54 45 29 2d 3e 76 69 65 | 77 52 65 63 74 3b 09 2f |TE)->vie|wRect;./|
|00002c70| 2f 20 67 65 74 20 61 20 | 6c 6f 63 61 6c 20 63 6f |/ get a |local co|
|00002c80| 70 79 20 6f 66 20 76 69 | 65 77 52 65 63 74 0d 09 |py of vi|ewRect..|
|00002c90| 53 65 74 50 6f 72 74 28 | 66 44 6f 63 57 69 6e 64 |SetPort(|fDocWind|
|00002ca0| 6f 77 29 3b 09 09 09 2f | 2f 20 6d 61 6b 65 20 73 |ow);.../|/ make s|
|00002cb0| 75 72 65 20 77 65 20 68 | 61 76 65 20 72 69 67 68 |ure we h|ave righ|
|00002cc0| 74 20 70 6f 72 74 0d 09 | 4c 6f 63 61 6c 54 6f 47 |t port..|LocalToG|
|00002cd0| 6c 6f 62 61 6c 28 28 50 | 6f 69 6e 74 2a 29 20 26 |lobal((P|oint*) &|
|00002ce0| 74 65 52 65 63 74 2e 74 | 6f 70 29 3b 0d 09 4c 6f |teRect.t|op);..Lo|
|00002cf0| 63 61 6c 54 6f 47 6c 6f | 62 61 6c 28 28 50 6f 69 |calToGlo|bal((Poi|
|00002d00| 6e 74 2a 29 20 26 74 65 | 52 65 63 74 2e 62 6f 74 |nt*) &te|Rect.bot|
|00002d10| 74 6f 6d 29 3b 0d 09 52 | 65 63 74 52 67 6e 28 72 |tom);..R|ectRgn(r|
|00002d20| 67 6e 2c 20 26 74 65 52 | 65 63 74 29 3b 0d 09 2f |gn, &teR|ect);../|
|00002d30| 2f 20 77 65 20 74 65 6d | 70 6f 72 61 72 69 6c 79 |/ we tem|porarily|
|00002d40| 20 63 68 61 6e 67 65 20 | 74 68 65 20 70 6f 72 74 | change |the port|
|00002d50| d5 73 20 6f 72 69 67 69 | 6e 20 74 6f 20 d2 67 6c |.s origi|n to .gl|
|00002d60| 6f 62 61 6c 66 79 d3 20 | 74 68 65 20 76 69 73 52 |obalfy. |the visR|
|00002d70| 67 6e 0d 09 53 65 74 4f | 72 69 67 69 6e 28 2d 28 |gn..SetO|rigin(-(|
|00002d80| 66 44 6f 63 57 69 6e 64 | 6f 77 2d 3e 70 6f 72 74 |fDocWind|ow->port|
|00002d90| 42 69 74 73 2e 62 6f 75 | 6e 64 73 2e 6c 65 66 74 |Bits.bou|nds.left|
|00002da0| 29 2c 0d 09 09 09 20 20 | 2d 28 66 44 6f 63 57 69 |),.... |-(fDocWi|
|00002db0| 6e 64 6f 77 2d 3e 70 6f | 72 74 42 69 74 73 2e 62 |ndow->po|rtBits.b|
|00002dc0| 6f 75 6e 64 73 2e 74 6f | 70 29 29 3b 0d 09 53 65 |ounds.to|p));..Se|
|00002dd0| 63 74 52 67 6e 28 72 67 | 6e 2c 20 66 44 6f 63 57 |ctRgn(rg|n, fDocW|
|00002de0| 69 6e 64 6f 77 2d 3e 76 | 69 73 52 67 6e 2c 20 72 |indow->v|isRgn, r|
|00002df0| 67 6e 29 3b 0d 09 53 65 | 74 4f 72 69 67 69 6e 28 |gn);..Se|tOrigin(|
|00002e00| 30 2c 20 30 29 3b 0d 7d | 20 2f 2f 20 47 65 74 54 |0, 0);.}| // GetT|
|00002e10| 45 52 67 6e 0d 0d 76 6f | 69 64 20 54 45 44 6f 63 |ERgn..vo|id TEDoc|
|00002e20| 75 6d 65 6e 74 3a 3a 52 | 65 61 64 46 72 6f 6d 46 |ument::R|eadFromF|
|00002e30| 69 6c 65 28 73 68 6f 72 | 74 20 72 65 66 4e 75 6d |ile(shor|t refNum|
|00002e40| 29 0d 7b 0d 09 6c 6f 6e | 67 20 63 75 72 50 6f 73 |).{..lon|g curPos|
|00002e50| 2c 20 73 69 7a 65 3b 0d | 09 48 61 6e 64 6c 65 20 |, size;.|.Handle |
|00002e60| 68 3b 0d 0d 09 2f 2f 20 | 64 65 74 65 72 6d 69 6e |h;...// |determin|
|00002e70| 65 20 68 6f 77 20 6d 75 | 63 68 20 64 61 74 61 20 |e how mu|ch data |
|00002e80| 69 73 20 61 76 61 69 6c | 61 62 6c 65 20 74 6f 20 |is avail|able to |
|00002e90| 72 65 61 64 0d 09 46 61 | 69 6c 4f 53 45 72 72 28 |read..Fa|ilOSErr(|
|00002ea0| 47 65 74 46 50 6f 73 28 | 72 65 66 4e 75 6d 2c 26 |GetFPos(|refNum,&|
|00002eb0| 63 75 72 50 6f 73 29 29 | 3b 0d 09 46 61 69 6c 4f |curPos))|;..FailO|
|00002ec0| 53 45 72 72 28 47 65 74 | 45 4f 46 28 72 65 66 4e |SErr(Get|EOF(refN|
|00002ed0| 75 6d 2c 26 73 69 7a 65 | 29 29 3b 0d 09 73 69 7a |um,&size|));..siz|
|00002ee0| 65 20 2d 3d 20 63 75 72 | 50 6f 73 3b 0d 0d 09 2f |e -= cur|Pos;.../|
|00002ef0| 2f 20 63 68 65 63 6b 20 | 66 6f 72 20 73 69 7a 65 |/ check |for size|
|00002f00| 20 3e 20 33 32 4b 0d 09 | 69 66 20 28 73 69 7a 65 | > 32K..|if (size|
|00002f10| 20 3e 20 6b 4d 61 78 54 | 45 4c 65 6e 67 74 68 29 | > kMaxT|ELength)|
|00002f20| 0d 09 20 20 46 61 69 6c | 75 72 65 28 65 45 78 63 |.. Fail|ure(eExc|
|00002f30| 65 65 64 43 68 61 72 2c | 6b 54 45 44 6f 63 45 72 |eedChar,|kTEDocEr|
|00002f40| 72 53 74 72 69 6e 67 73 | 29 3b 0d 0d 09 2f 2f 20 |rStrings|);...// |
|00002f50| 61 6c 6c 6f 63 61 74 65 | 20 61 20 68 61 6e 64 6c |allocate| a handl|
|00002f60| 65 20 74 6f 20 73 74 6f | 72 65 20 69 74 20 69 6e |e to sto|re it in|
|00002f70| 0d 09 68 20 3d 20 4e 65 | 77 48 61 6e 64 6c 65 28 |..h = Ne|wHandle(|
|00002f80| 73 69 7a 65 29 3b 0d 09 | 46 61 69 6c 4e 49 4c 28 |size);..|FailNIL(|
|00002f90| 68 29 3b 0d 0d 09 54 52 | 59 0d 09 20 20 7b 0d 09 |h);...TR|Y.. {..|
|00002fa0| 09 46 61 69 6c 4f 53 45 | 72 72 28 46 53 52 65 61 |.FailOSE|rr(FSRea|
|00002fb0| 64 28 72 65 66 4e 75 6d | 2c 26 73 69 7a 65 2c 2a |d(refNum|,&size,*|
|00002fc0| 68 29 29 3b 0d 09 20 20 | 7d 0d 09 52 45 43 4f 56 |h));.. |}..RECOV|
|00002fd0| 45 52 0d 09 20 20 7b 0d | 09 09 44 69 73 70 6f 73 |ER.. {.|..Dispos|
|00002fe0| 48 61 6e 64 6c 65 28 68 | 29 3b 0d 09 20 20 7d 0d |Handle(h|);.. }.|
|00002ff0| 09 45 4e 44 54 52 59 0d | 0d 09 2f 2f 20 6e 6f 77 |.ENDTRY.|..// now|
|00003000| 20 6d 61 6b 65 20 74 68 | 65 20 74 65 78 74 20 74 | make th|e text t|
|00003010| 68 65 20 63 75 72 72 65 | 6e 74 20 74 65 78 74 0d |he curre|nt text.|
|00003020| 09 53 65 74 50 6f 72 74 | 28 66 44 6f 63 57 69 6e |.SetPort|(fDocWin|
|00003030| 64 6f 77 29 3b 0d 09 48 | 4c 6f 63 6b 28 68 29 3b |dow);..H|Lock(h);|
|00003040| 0d 09 54 45 53 65 74 54 | 65 78 74 28 2a 68 2c 73 |..TESetT|ext(*h,s|
|00003050| 69 7a 65 2c 66 44 6f 63 | 54 45 29 3b 0d 09 44 69 |ize,fDoc|TE);..Di|
|00003060| 73 70 6f 73 48 61 6e 64 | 6c 65 28 68 29 3b 0d 0d |sposHand|le(h);..|
|00003070| 09 2f 2f 20 6d 61 6b 65 | 20 73 75 72 65 20 65 76 |.// make| sure ev|
|00003080| 65 72 79 74 68 69 6e 67 | 20 69 73 20 75 70 20 74 |erything| is up t|
|00003090| 6f 20 64 61 74 65 0d 09 | 52 65 63 74 20 74 52 65 |o date..|Rect tRe|
|000030a0| 63 74 20 3d 20 28 2a 66 | 44 6f 63 54 45 29 2d 3e |ct = (*f|DocTE)->|
|000030b0| 76 69 65 77 52 65 63 74 | 3b 0d 09 49 6e 76 61 6c |viewRect|;..Inval|
|000030c0| 52 65 63 74 28 26 74 52 | 65 63 74 29 3b 0d 09 41 |Rect(&tR|ect);..A|
|000030d0| 64 6a 75 73 74 54 45 28 | 29 3b 0d 09 41 64 6a 75 |djustTE(|);..Adju|
|000030e0| 73 74 53 63 72 6f 6c 6c | 62 61 72 73 28 66 61 6c |stScroll|bars(fal|
|000030f0| 73 65 29 3b 0d 7d 0d 0d | 76 6f 69 64 20 54 45 44 |se);.}..|void TED|
|00003100| 6f 63 75 6d 65 6e 74 3a | 3a 57 72 69 74 65 54 6f |ocument:|:WriteTo|
|00003110| 46 69 6c 65 28 73 68 6f | 72 74 20 72 65 66 4e 75 |File(sho|rt refNu|
|00003120| 6d 29 0d 7b 0d 09 48 61 | 6e 64 6c 65 20 68 3b 0d |m).{..Ha|ndle h;.|
|00003130| 09 6c 6f 6e 67 20 73 69 | 7a 65 3b 0d 0d 09 2f 2f |.long si|ze;...//|
|00003140| 20 67 65 74 20 43 4f 50 | 59 20 6f 66 20 54 45 48 | get COP|Y of TEH|
|00003150| 61 6e 64 6c 65 20 2d 20 | 64 6f 65 73 6e 27 74 20 |andle - |doesn't |
|00003160| 61 6c 6c 6f 63 20 6d 65 | 6d 6f 72 79 0d 09 68 20 |alloc me|mory..h |
|00003170| 3d 20 28 48 61 6e 64 6c | 65 29 20 54 45 47 65 74 |= (Handl|e) TEGet|
|00003180| 54 65 78 74 28 66 44 6f | 63 54 45 29 3b 0d 09 73 |Text(fDo|cTE);..s|
|00003190| 69 7a 65 20 3d 20 47 65 | 74 48 61 6e 64 6c 65 53 |ize = Ge|tHandleS|
|000031a0| 69 7a 65 28 68 29 3b 0d | 09 46 61 69 6c 4f 53 45 |ize(h);.|.FailOSE|
|000031b0| 72 72 28 46 53 57 72 69 | 74 65 28 72 65 66 4e 75 |rr(FSWri|te(refNu|
|000031c0| 6d 2c 26 73 69 7a 65 2c | 2a 68 29 29 3b 0d 7d 0d |m,&size,|*h));.}.|
|000031d0| 0d 2f 2f 20 52 65 74 75 | 72 6e 20 62 6f 6f 6c 65 |.// Retu|rn boole|
|000031e0| 61 6e 20 76 61 6c 75 65 | 20 69 6e 64 69 63 61 74 |an value| indicat|
|000031f0| 69 6e 67 20 74 68 61 74 | 20 74 68 65 72 65 20 69 |ing that| there i|
|00003200| 73 20 6f 72 20 69 73 20 | 6e 6f 74 20 61 0d 2f 2f |s or is |not a.//|
|00003210| 20 73 65 6c 65 63 74 69 | 6f 6e 20 69 6e 20 74 68 | selecti|on in th|
|00003220| 65 20 64 6f 63 75 6d 65 | 6e 74 0d 0d 42 6f 6f 6c |e docume|nt..Bool|
|00003230| 65 61 6e 20 54 45 44 6f | 63 75 6d 65 6e 74 3a 3a |ean TEDo|cument::|
|00003240| 48 61 76 65 53 65 6c 65 | 63 74 69 6f 6e 28 29 0d |HaveSele|ction().|
|00003250| 7b 0d 09 69 66 20 28 20 | 28 2a 66 44 6f 63 54 45 |{..if ( |(*fDocTE|
|00003260| 29 2d 3e 73 65 6c 53 74 | 61 72 74 20 3c 20 28 2a |)->selSt|art < (*|
|00003270| 66 44 6f 63 54 45 29 2d | 3e 73 65 6c 45 6e 64 20 |fDocTE)-|>selEnd |
|00003280| 29 0d 09 20 20 72 65 74 | 75 72 6e 20 74 72 75 65 |).. ret|urn true|
|00003290| 3b 0d 09 65 6c 73 65 20 | 72 65 74 75 72 6e 20 66 |;..else |return f|
|000032a0| 61 6c 73 65 3b 0d 7d 0d | 0d 2f 2f 20 55 70 64 61 |alse;.}.|.// Upda|
|000032b0| 74 65 20 74 68 65 20 54 | 45 52 65 63 27 73 20 76 |te the T|ERec's v|
|000032c0| 69 65 77 20 72 65 63 74 | 20 73 6f 20 74 68 61 74 |iew rect| so that|
|000032d0| 20 69 74 20 69 73 20 74 | 68 65 20 67 72 65 61 74 | it is t|he great|
|000032e0| 65 73 74 20 6d 75 6c 74 | 69 70 6c 65 20 6f 66 0d |est mult|iple of.|
|000032f0| 2f 2f 20 74 68 65 20 6c | 69 6e 65 48 65 69 67 68 |// the l|ineHeigh|
|00003300| 74 20 74 68 61 74 20 73 | 74 69 6c 6c 20 66 69 74 |t that s|till fit|
|00003310| 73 20 69 6e 20 74 68 65 | 20 6f 6c 64 20 76 69 65 |s in the| old vie|
|00003320| 77 52 65 63 74 2e 0d 0d | 76 6f 69 64 20 54 45 44 |wRect...|void TED|
|00003330| 6f 63 75 6d 65 6e 74 3a | 3a 41 64 6a 75 73 74 56 |ocument:|:AdjustV|
|00003340| 69 65 77 52 65 63 74 28 | 29 0d 7b 0d 09 54 45 50 |iewRect(|).{..TEP|
|00003350| 74 72 20 74 65 3b 0d 0d | 09 74 65 20 3d 20 2a 66 |tr te;..|.te = *f|
|00003360| 44 6f 63 54 45 3b 0d 09 | 74 65 2d 3e 76 69 65 77 |DocTE;..|te->view|
|00003370| 52 65 63 74 2e 62 6f 74 | 74 6f 6d 20 3d 20 28 28 |Rect.bot|tom = ((|
|00003380| 28 74 65 2d 3e 76 69 65 | 77 52 65 63 74 2e 62 6f |(te->vie|wRect.bo|
|00003390| 74 74 6f 6d 20 2d 20 74 | 65 2d 3e 76 69 65 77 52 |ttom - t|e->viewR|
|000033a0| 65 63 74 2e 74 6f 70 29 | 20 2f 20 74 65 2d 3e 6c |ect.top)| / te->l|
|000033b0| 69 6e 65 48 65 69 67 68 | 74 29 0d 09 09 09 09 09 |ineHeigh|t)......|
|000033c0| 09 09 2a 20 74 65 2d 3e | 6c 69 6e 65 48 65 69 67 |..* te->|lineHeig|
|000033d0| 68 74 29 20 2b 20 74 65 | 2d 3e 76 69 65 77 52 65 |ht) + te|->viewRe|
|000033e0| 63 74 2e 74 6f 70 3b 0d | 7d 20 2f 2f 20 41 64 6a |ct.top;.|} // Adj|
|000033f0| 75 73 74 56 69 65 77 52 | 65 63 74 0d 0d 2f 2f 20 |ustViewR|ect..// |
|00003400| 53 63 72 6f 6c 6c 20 74 | 68 65 20 54 45 52 65 63 |Scroll t|he TERec|
|00003410| 20 61 72 6f 75 6e 64 20 | 74 6f 20 6d 61 74 63 68 | around |to match|
|00003420| 20 75 70 20 74 6f 20 74 | 68 65 20 70 6f 74 65 6e | up to t|he poten|
|00003430| 74 69 61 6c 6c 79 20 75 | 70 64 61 74 65 64 20 73 |tially u|pdated s|
|00003440| 63 72 6f 6c 6c 62 61 72 | 0d 2f 2f 20 76 61 6c 75 |crollbar|.// valu|
|00003450| 65 73 2e 20 54 68 69 73 | 20 69 73 20 72 65 61 6c |es. This| is real|
|00003460| 6c 79 20 75 73 65 66 75 | 6c 20 77 68 65 6e 20 74 |ly usefu|l when t|
|00003470| 68 65 20 77 69 6e 64 6f | 77 20 68 61 73 20 62 65 |he windo|w has be|
|00003480| 65 6e 20 72 65 73 69 7a | 65 64 20 73 75 63 68 20 |en resiz|ed such |
|00003490| 74 68 61 74 20 74 68 65 | 0d 2f 2f 20 73 63 72 6f |that the|.// scro|
|000034a0| 6c 6c 62 61 72 73 20 62 | 65 63 61 6d 65 20 69 6e |llbars b|ecame in|
|000034b0| 61 63 74 69 76 65 20 62 | 75 74 20 74 68 65 20 54 |active b|ut the T|
|000034c0| 45 52 65 63 20 77 61 73 | 20 61 6c 72 65 61 64 79 |ERec was| already|
|000034d0| 20 73 63 72 6f 6c 6c 65 | 64 2e 0d 0d 76 6f 69 64 | scrolle|d...void|
|000034e0| 20 54 45 44 6f 63 75 6d | 65 6e 74 3a 3a 41 64 6a | TEDocum|ent::Adj|
|000034f0| 75 73 74 54 45 28 29 0d | 7b 0d 09 54 45 50 74 72 |ustTE().|{..TEPtr|
|00003500| 20 74 65 3b 0d 0d 09 74 | 65 20 3d 20 2a 66 44 6f | te;...t|e = *fDo|
|00003510| 63 54 45 3b 0d 09 54 45 | 53 63 72 6f 6c 6c 28 28 |cTE;..TE|Scroll((|
|00003520| 74 65 2d 3e 76 69 65 77 | 52 65 63 74 2e 6c 65 66 |te->view|Rect.lef|
|00003530| 74 20 2d 20 74 65 2d 3e | 64 65 73 74 52 65 63 74 |t - te->|destRect|
|00003540| 2e 6c 65 66 74 29 20 2d | 20 47 65 74 43 74 6c 56 |.left) -| GetCtlV|
|00003550| 61 6c 75 65 28 66 44 6f | 63 48 53 63 72 6f 6c 6c |alue(fDo|cHScroll|
|00003560| 29 2c 0d 09 09 09 20 28 | 74 65 2d 3e 76 69 65 77 |),.... (|te->view|
|00003570| 52 65 63 74 2e 74 6f 70 | 20 2d 20 74 65 2d 3e 64 |Rect.top| - te->d|
|00003580| 65 73 74 52 65 63 74 2e | 74 6f 70 29 20 2d 0d 09 |estRect.|top) -..|
|00003590| 09 09 20 09 28 47 65 74 | 43 74 6c 56 61 6c 75 65 |.. .(Get|CtlValue|
|000035a0| 28 66 44 6f 63 56 53 63 | 72 6f 6c 6c 29 20 2a 20 |(fDocVSc|roll) * |
|000035b0| 74 65 2d 3e 6c 69 6e 65 | 48 65 69 67 68 74 29 2c |te->line|Height),|
|000035c0| 0d 09 09 09 20 66 44 6f | 63 54 45 29 3b 0d 7d 20 |.... fDo|cTE);.} |
|000035d0| 2f 2f 20 41 64 6a 75 73 | 74 54 45 0d 0d 2f 2f 20 |// Adjus|tTE..// |
|000035e0| 52 65 2d 63 61 6c 63 75 | 6c 61 74 65 20 74 68 65 |Re-calcu|late the|
|000035f0| 20 70 6f 73 69 74 69 6f | 6e 20 61 6e 64 20 73 69 | positio|n and si|
|00003600| 7a 65 20 6f 66 20 74 68 | 65 20 76 69 65 77 52 65 |ze of th|e viewRe|
|00003610| 63 74 20 61 6e 64 20 74 | 68 65 20 73 63 72 6f 6c |ct and t|he scrol|
|00003620| 6c 62 61 72 73 2e 0d 2f | 2f 20 6b 53 63 72 6f 6c |lbars../|/ kScrol|
|00003630| 6c 54 77 65 65 6b 20 63 | 6f 6d 70 65 6e 73 61 74 |lTweek c|ompensat|
|00003640| 65 73 20 66 6f 72 20 6f | 66 66 2d 62 79 2d 6f 6e |es for o|ff-by-on|
|00003650| 65 20 72 65 71 75 69 72 | 65 6d 65 6e 74 73 20 6f |e requir|ements o|
|00003660| 66 20 74 68 65 20 73 63 | 72 6f 6c 6c 62 61 72 73 |f the sc|rollbars|
|00003670| 0d 2f 2f 20 74 6f 20 68 | 61 76 65 20 62 6f 72 64 |.// to h|ave bord|
|00003680| 65 72 73 20 63 6f 69 6e | 63 69 64 65 20 77 69 74 |ers coin|cide wit|
|00003690| 68 20 74 68 65 20 67 72 | 6f 77 62 6f 78 2e 0d 0d |h the gr|owbox...|
|000036a0| 76 6f 69 64 20 54 45 44 | 6f 63 75 6d 65 6e 74 3a |void TED|ocument:|
|000036b0| 3a 41 64 6a 75 73 74 53 | 63 72 6f 6c 6c 53 69 7a |:AdjustS|crollSiz|
|000036c0| 65 73 28 29 0d 7b 0d 09 | 52 65 63 74 20 74 65 52 |es().{..|Rect teR|
|000036d0| 65 63 74 3b 0d 0d 09 47 | 65 74 54 45 52 65 63 74 |ect;...G|etTERect|
|000036e0| 28 26 74 65 52 65 63 74 | 29 3b 0d 09 28 2a 66 44 |(&teRect|);..(*fD|
|000036f0| 6f 63 54 45 29 2d 3e 76 | 69 65 77 52 65 63 74 20 |ocTE)->v|iewRect |
|00003700| 3d 20 74 65 52 65 63 74 | 3b 0d 09 41 64 6a 75 73 |= teRect|;..Adjus|
|00003710| 74 56 69 65 77 52 65 63 | 74 28 29 3b 0d 09 4d 6f |tViewRec|t();..Mo|
|00003720| 76 65 43 6f 6e 74 72 6f | 6c 28 66 44 6f 63 56 53 |veContro|l(fDocVS|
|00003730| 63 72 6f 6c 6c 2c 20 66 | 44 6f 63 57 69 6e 64 6f |croll, f|DocWindo|
|00003740| 77 2d 3e 70 6f 72 74 52 | 65 63 74 2e 72 69 67 68 |w->portR|ect.righ|
|00003750| 74 20 2d 20 6b 53 63 72 | 6f 6c 6c 62 61 72 41 64 |t - kScr|ollbarAd|
|00003760| 6a 75 73 74 2c 20 2d 31 | 29 3b 0d 09 53 69 7a 65 |just, -1|);..Size|
|00003770| 43 6f 6e 74 72 6f 6c 28 | 66 44 6f 63 56 53 63 72 |Control(|fDocVScr|
|00003780| 6f 6c 6c 2c 20 6b 53 63 | 72 6f 6c 6c 62 61 72 57 |oll, kSc|rollbarW|
|00003790| 69 64 74 68 2c 0d 09 09 | 09 09 66 44 6f 63 57 69 |idth,...|..fDocWi|
|000037a0| 6e 64 6f 77 2d 3e 70 6f | 72 74 52 65 63 74 2e 62 |ndow->po|rtRect.b|
|000037b0| 6f 74 74 6f 6d 20 2d 20 | 66 44 6f 63 57 69 6e 64 |ottom - |fDocWind|
|000037c0| 6f 77 2d 3e 70 6f 72 74 | 52 65 63 74 2e 74 6f 70 |ow->port|Rect.top|
|000037d0| 20 2d 0d 09 09 09 09 09 | 6b 47 72 6f 77 62 6f 78 | -......|kGrowbox|
|000037e0| 41 64 6a 75 73 74 20 2b | 20 6b 53 63 72 6f 6c 6c |Adjust +| kScroll|
|000037f0| 54 77 65 65 6b 29 3b 0d | 09 4d 6f 76 65 43 6f 6e |Tweek);.|.MoveCon|
|00003800| 74 72 6f 6c 28 66 44 6f | 63 48 53 63 72 6f 6c 6c |trol(fDo|cHScroll|
|00003810| 2c 20 2d 31 2c 20 66 44 | 6f 63 57 69 6e 64 6f 77 |, -1, fD|ocWindow|
|00003820| 2d 3e 70 6f 72 74 52 65 | 63 74 2e 62 6f 74 74 6f |->portRe|ct.botto|
|00003830| 6d 20 2d 20 6b 53 63 72 | 6f 6c 6c 62 61 72 41 64 |m - kScr|ollbarAd|
|00003840| 6a 75 73 74 29 3b 0d 09 | 53 69 7a 65 43 6f 6e 74 |just);..|SizeCont|
|00003850| 72 6f 6c 28 66 44 6f 63 | 48 53 63 72 6f 6c 6c 2c |rol(fDoc|HScroll,|
|00003860| 0d 09 09 09 09 66 44 6f | 63 57 69 6e 64 6f 77 2d |.....fDo|cWindow-|
|00003870| 3e 70 6f 72 74 52 65 63 | 74 2e 72 69 67 68 74 20 |>portRec|t.right |
|00003880| 2d 20 66 44 6f 63 57 69 | 6e 64 6f 77 2d 3e 70 6f |- fDocWi|ndow->po|
|00003890| 72 74 52 65 63 74 2e 6c | 65 66 74 20 2d 0d 09 09 |rtRect.l|eft -...|
|000038a0| 09 09 09 6b 47 72 6f 77 | 62 6f 78 41 64 6a 75 73 |...kGrow|boxAdjus|
|000038b0| 74 20 2b 20 6b 53 63 72 | 6f 6c 6c 54 77 65 65 6b |t + kScr|ollTweek|
|000038c0| 2c 0d 09 09 09 09 6b 53 | 63 72 6f 6c 6c 62 61 72 |,.....kS|crollbar|
|000038d0| 57 69 64 74 68 29 3b 0d | 7d 20 2f 2f 20 41 64 6a |Width);.|} // Adj|
|000038e0| 75 73 74 53 63 72 6f 6c | 6c 53 69 7a 65 73 0d 0d |ustScrol|lSizes..|
|000038f0| 2f 2f 20 54 75 72 6e 20 | 6f 66 66 20 74 68 65 20 |// Turn |off the |
|00003900| 63 6f 6e 74 72 6f 6c 73 | 20 62 79 20 6a 61 6d 6d |controls| by jamm|
|00003910| 69 6e 67 20 61 20 7a 65 | 72 6f 20 69 6e 74 6f 20 |ing a ze|ro into |
|00003920| 74 68 65 69 72 20 63 6f | 6e 74 72 6c 56 69 73 20 |their co|ntrlVis |
|00003930| 66 69 65 6c 64 73 20 28 | 48 69 64 65 43 6f 6e 74 |fields (|HideCont|
|00003940| 72 6f 6c 20 65 72 61 73 | 65 73 20 74 68 65 6d 0d |rol eras|es them.|
|00003950| 2f 2f 20 61 6e 64 20 77 | 65 20 64 6f 6e 27 74 20 |// and w|e don't |
|00003960| 77 61 6e 74 20 74 68 61 | 74 29 2e 20 49 66 20 74 |want tha|t). If t|
|00003970| 68 65 20 63 6f 6e 74 72 | 6f 6c 73 20 61 72 65 20 |he contr|ols are |
|00003980| 74 6f 20 62 65 20 72 65 | 73 69 7a 65 64 20 61 73 |to be re|sized as|
|00003990| 20 77 65 6c 6c 2c 20 63 | 61 6c 6c 20 74 68 65 20 | well, c|all the |
|000039a0| 70 72 6f 63 65 64 75 72 | 65 20 74 6f 20 64 6f 20 |procedur|e to do |
|000039b0| 74 68 61 74 2c 0d 2f 2f | 20 74 68 65 6e 20 63 61 |that,.//| then ca|
|000039c0| 6c 6c 20 74 68 65 20 70 | 72 6f 63 65 64 75 72 65 |ll the p|rocedure|
|000039d0| 20 74 6f 20 61 64 6a 75 | 73 74 20 74 68 65 20 6d | to adju|st the m|
|000039e0| 61 78 69 6d 75 6d 20 61 | 6e 64 20 63 75 72 72 65 |aximum a|nd curre|
|000039f0| 6e 74 20 76 61 6c 75 65 | 73 2e 20 46 69 6e 61 6c |nt value|s. Final|
|00003a00| 6c 79 20 72 65 2d 65 6e | 61 62 6c 65 20 74 68 65 |ly re-en|able the|
|00003a10| 20 63 6f 6e 74 72 6f 6c | 73 0d 2f 2f 20 62 79 20 | control|s.// by |
|00003a20| 6a 61 6d 6d 69 6e 67 20 | 61 20 24 46 46 20 69 6e |jamming |a $FF in|
|00003a30| 20 74 68 65 69 72 20 63 | 6f 6e 74 72 6c 56 69 73 | their c|ontrlVis|
|00003a40| 20 66 69 65 6c 64 73 20 | 28 53 68 6f 77 43 6f 6e | fields |(ShowCon|
|00003a50| 74 72 6f 6c 20 72 65 2d | 64 72 61 77 73 20 74 68 |trol re-|draws th|
|00003a60| 65 20 63 6f 6e 74 72 6f | 6c 2c 20 77 68 69 63 68 |e contro|l, which|
|00003a70| 20 6d 61 79 20 6e 6f 74 | 20 62 65 0d 2f 2f 20 6e | may not| be.// n|
|00003a80| 65 63 65 73 73 61 72 79 | 29 2e 0d 0d 76 6f 69 64 |ecessary|)...void|
|00003a90| 20 54 45 44 6f 63 75 6d | 65 6e 74 3a 3a 41 64 6a | TEDocum|ent::Adj|
|00003aa0| 75 73 74 53 63 72 6f 6c | 6c 62 61 72 73 28 42 6f |ustScrol|lbars(Bo|
|00003ab0| 6f 6c 65 61 6e 20 6e 65 | 65 64 73 52 65 73 69 7a |olean ne|edsResiz|
|00003ac0| 65 29 0d 7b 0d 09 2f 2f | 20 46 69 72 73 74 2c 20 |e).{..//| First, |
|00003ad0| 74 75 72 6e 20 76 69 73 | 69 62 69 6c 69 74 79 20 |turn vis|ibility |
|00003ae0| 6f 66 20 73 63 72 6f 6c | 6c 62 61 72 73 20 6f 66 |of scrol|lbars of|
|00003af0| 66 20 73 6f 20 77 65 20 | 77 6f 6e d5 74 20 67 65 |f so we |won.t ge|
|00003b00| 74 20 75 6e 77 61 6e 74 | 65 64 20 72 65 64 72 61 |t unwant|ed redra|
|00003b10| 77 69 6e 67 0d 09 28 2a | 66 44 6f 63 56 53 63 72 |wing..(*|fDocVScr|
|00003b20| 6f 6c 6c 29 2d 3e 63 6f | 6e 74 72 6c 56 69 73 20 |oll)->co|ntrlVis |
|00003b30| 3d 20 30 3b 0d 09 28 2a | 66 44 6f 63 48 53 63 72 |= 0;..(*|fDocHScr|
|00003b40| 6f 6c 6c 29 2d 3e 63 6f | 6e 74 72 6c 56 69 73 20 |oll)->co|ntrlVis |
|00003b50| 3d 20 30 3b 0d 09 69 66 | 20 28 20 6e 65 65 64 73 |= 0;..if| ( needs|
|00003b60| 52 65 73 69 7a 65 20 29 | 0d 09 20 20 41 64 6a 75 |Resize )|.. Adju|
|00003b70| 73 74 53 63 72 6f 6c 6c | 53 69 7a 65 73 28 29 3b |stScroll|Sizes();|
|00003b80| 0d 09 41 64 6a 75 73 74 | 53 63 72 6f 6c 6c 56 61 |..Adjust|ScrollVa|
|00003b90| 6c 75 65 73 28 6e 65 65 | 64 73 52 65 73 69 7a 65 |lues(nee|dsResize|
|00003ba0| 29 3b 0d 09 2f 2f 20 4e | 6f 77 2c 20 72 65 73 74 |);..// N|ow, rest|
|00003bb0| 6f 72 65 20 76 69 73 69 | 62 69 6c 69 74 79 20 69 |ore visi|bility i|
|00003bc0| 6e 20 63 61 73 65 20 77 | 65 20 6e 65 76 65 72 20 |n case w|e never |
|00003bd0| 68 61 64 20 74 6f 20 64 | 72 61 77 20 64 75 72 69 |had to d|raw duri|
|00003be0| 6e 67 20 61 64 6a 75 73 | 74 6d 65 6e 74 0d 09 28 |ng adjus|tment..(|
|00003bf0| 2a 66 44 6f 63 56 53 63 | 72 6f 6c 6c 29 2d 3e 63 |*fDocVSc|roll)->c|
|00003c00| 6f 6e 74 72 6c 56 69 73 | 20 3d 20 30 78 66 66 3b |ontrlVis| = 0xff;|
|00003c10| 0d 09 28 2a 66 44 6f 63 | 48 53 63 72 6f 6c 6c 29 |..(*fDoc|HScroll)|
|00003c20| 2d 3e 63 6f 6e 74 72 6c | 56 69 73 20 3d 20 30 78 |->contrl|Vis = 0x|
|00003c30| 66 66 3b 0d 7d 20 2f 2f | 20 41 64 6a 75 73 74 53 |ff;.} //| AdjustS|
|00003c40| 63 72 6f 6c 6c 62 61 72 | 73 0d 0d 2f 2f 20 43 61 |crollbar|s..// Ca|
|00003c50| 6c 63 75 6c 61 74 65 20 | 74 68 65 20 6e 65 77 20 |lculate |the new |
|00003c60| 63 6f 6e 74 72 6f 6c 20 | 6d 61 78 69 6d 75 6d 20 |control |maximum |
|00003c70| 76 61 6c 75 65 20 61 6e | 64 20 63 75 72 72 65 6e |value an|d curren|
|00003c80| 74 20 76 61 6c 75 65 2c | 20 77 68 65 74 68 65 72 |t value,| whether|
|00003c90| 20 69 74 20 69 73 20 74 | 68 65 20 68 6f 72 69 7a | it is t|he horiz|
|00003ca0| 6f 6e 74 61 6c 20 6f 72 | 0d 2f 2f 20 76 65 72 74 |ontal or|.// vert|
|00003cb0| 69 63 61 6c 20 73 63 72 | 6f 6c 6c 62 61 72 2e 20 |ical scr|ollbar. |
|00003cc0| 54 68 65 20 76 65 72 74 | 69 63 61 6c 20 6d 61 78 |The vert|ical max|
|00003cd0| 20 69 73 20 63 61 6c 63 | 75 6c 61 74 65 64 20 62 | is calc|ulated b|
|00003ce0| 79 20 63 6f 6d 70 61 72 | 69 6e 67 20 74 68 65 20 |y compar|ing the |
|00003cf0| 6e 75 6d 62 65 72 20 6f | 66 20 6c 69 6e 65 73 20 |number o|f lines |
|00003d00| 74 6f 20 74 68 65 0d 2f | 2f 20 76 65 72 74 69 63 |to the./|/ vertic|
|00003d10| 61 6c 20 73 69 7a 65 20 | 6f 66 20 74 68 65 20 76 |al size |of the v|
|00003d20| 69 65 77 52 65 63 74 2e | 20 54 68 65 20 68 6f 72 |iewRect.| The hor|
|00003d30| 69 7a 6f 6e 74 61 6c 20 | 6d 61 78 20 69 73 20 63 |izontal |max is c|
|00003d40| 61 6c 63 75 6c 61 74 65 | 64 20 62 79 20 63 6f 6d |alculate|d by com|
|00003d50| 70 61 72 69 6e 67 20 74 | 68 65 20 6d 61 78 69 6d |paring t|he maxim|
|00003d60| 75 6d 20 64 6f 63 75 6d | 65 6e 74 0d 2f 2f 20 77 |um docum|ent.// w|
|00003d70| 69 64 74 68 20 74 6f 20 | 74 68 65 20 77 69 64 74 |idth to |the widt|
|00003d80| 68 20 6f 66 20 74 68 65 | 20 76 69 65 77 52 65 63 |h of the| viewRec|
|00003d90| 74 2e 20 54 68 65 20 63 | 75 72 72 65 6e 74 20 76 |t. The c|urrent v|
|00003da0| 61 6c 75 65 73 20 61 72 | 65 20 73 65 74 20 62 79 |alues ar|e set by|
|00003db0| 20 63 6f 6d 70 61 72 69 | 6e 67 20 74 68 65 20 6f | compari|ng the o|
|00003dc0| 66 66 73 65 74 20 62 65 | 74 77 65 65 6e 0d 2f 2f |ffset be|tween.//|
|00003dd0| 20 74 68 65 20 76 69 65 | 77 20 61 6e 64 20 64 65 | the vie|w and de|
|00003de0| 73 74 69 6e 61 74 69 6f | 6e 20 72 65 63 74 73 2e |stinatio|n rects.|
|00003df0| 20 49 66 20 6e 65 63 65 | 73 73 61 72 79 2c 20 72 | If nece|ssary, r|
|00003e00| 65 64 72 61 77 20 74 68 | 65 20 63 6f 6e 74 72 6f |edraw th|e contro|
|00003e10| 6c 20 62 79 20 63 61 6c | 6c 69 6e 67 20 53 68 6f |l by cal|ling Sho|
|00003e20| 77 43 6f 6e 74 72 6f 6c | 2e 0d 0d 76 6f 69 64 20 |wControl|...void |
|00003e30| 54 45 44 6f 63 75 6d 65 | 6e 74 3a 3a 41 64 6a 75 |TEDocume|nt::Adju|
|00003e40| 73 74 48 56 28 42 6f 6f | 6c 65 61 6e 20 69 73 56 |stHV(Boo|lean isV|
|00003e50| 65 72 74 2c 42 6f 6f 6c | 65 61 6e 20 6d 75 73 74 |ert,Bool|ean must|
|00003e60| 52 65 64 72 61 77 29 0d | 7b 0d 09 73 68 6f 72 74 |Redraw).|{..short|
|00003e70| 20 76 61 6c 75 65 2c 20 | 6c 69 6e 65 73 2c 20 6d | value, |lines, m|
|00003e80| 61 78 3b 0d 09 73 68 6f | 72 74 20 6f 6c 64 56 61 |ax;..sho|rt oldVa|
|00003e90| 6c 75 65 2c 20 6f 6c 64 | 4d 61 78 3b 0d 09 54 45 |lue, old|Max;..TE|
|00003ea0| 50 74 72 20 74 65 3b 0d | 09 43 6f 6e 74 72 6f 6c |Ptr te;.|.Control|
|00003eb0| 48 61 6e 64 6c 65 20 63 | 6f 6e 74 72 6f 6c 3b 0d |Handle c|ontrol;.|
|00003ec0| 0d 09 69 66 20 28 69 73 | 56 65 72 74 29 0d 09 20 |..if (is|Vert).. |
|00003ed0| 20 63 6f 6e 74 72 6f 6c | 20 3d 20 66 44 6f 63 56 | control| = fDocV|
|00003ee0| 53 63 72 6f 6c 6c 3b 0d | 09 65 6c 73 65 20 63 6f |Scroll;.|.else co|
|00003ef0| 6e 74 72 6f 6c 20 3d 20 | 66 44 6f 63 48 53 63 72 |ntrol = |fDocHScr|
|00003f00| 6f 6c 6c 3b 0d 09 6f 6c | 64 56 61 6c 75 65 20 3d |oll;..ol|dValue =|
|00003f10| 20 47 65 74 43 74 6c 56 | 61 6c 75 65 28 63 6f 6e | GetCtlV|alue(con|
|00003f20| 74 72 6f 6c 29 3b 0d 09 | 6f 6c 64 4d 61 78 20 3d |trol);..|oldMax =|
|00003f30| 20 47 65 74 43 74 6c 4d | 61 78 28 63 6f 6e 74 72 | GetCtlM|ax(contr|
|00003f40| 6f 6c 29 3b 0d 09 74 65 | 20 3d 20 2a 66 44 6f 63 |ol);..te| = *fDoc|
|00003f50| 54 45 3b 09 09 09 09 09 | 09 09 2f 2f 20 70 6f 69 |TE;.....|..// poi|
|00003f60| 6e 74 20 74 6f 20 54 45 | 52 65 63 20 66 6f 72 20 |nt to TE|Rec for |
|00003f70| 63 6f 6e 76 65 6e 69 65 | 6e 63 65 0d 09 69 66 20 |convenie|nce..if |
|00003f80| 28 20 69 73 56 65 72 74 | 20 29 0d 09 20 20 7b 0d |( isVert| ).. {.|
|00003f90| 09 09 6c 69 6e 65 73 20 | 3d 20 74 65 2d 3e 6e 4c |..lines |= te->nL|
|00003fa0| 69 6e 65 73 3b 0d 09 09 | 2f 2f 20 73 69 6e 63 65 |ines;...|// since|
|00003fb0| 20 6e 4c 69 6e 65 73 20 | 69 73 6e d5 74 20 72 69 | nLines |isn.t ri|
|00003fc0| 67 68 74 20 69 66 20 74 | 68 65 20 6c 61 73 74 20 |ght if t|he last |
|00003fd0| 63 68 61 72 61 63 74 65 | 72 20 69 73 20 61 20 72 |characte|r is a r|
|00003fe0| 65 74 75 72 6e 2c 20 63 | 68 65 63 6b 20 66 6f 72 |eturn, c|heck for|
|00003ff0| 20 74 68 61 74 20 63 61 | 73 65 0d 09 09 69 66 20 | that ca|se...if |
|00004000| 28 20 2a 28 2a 74 65 2d | 3e 68 54 65 78 74 20 2b |( *(*te-|>hText +|
|00004010| 20 74 65 2d 3e 74 65 4c | 65 6e 67 74 68 20 2d 20 | te->teL|ength - |
|00004020| 31 29 20 3d 3d 20 6b 43 | 72 43 68 61 72 20 29 0d |1) == kC|rChar ).|
|00004030| 09 09 20 20 6c 69 6e 65 | 73 20 2b 3d 20 31 3b 0d |.. line|s += 1;.|
|00004040| 09 09 6d 61 78 20 3d 20 | 6c 69 6e 65 73 20 2d 20 |..max = |lines - |
|00004050| 28 28 74 65 2d 3e 76 69 | 65 77 52 65 63 74 2e 62 |((te->vi|ewRect.b|
|00004060| 6f 74 74 6f 6d 20 2d 20 | 74 65 2d 3e 76 69 65 77 |ottom - |te->view|
|00004070| 52 65 63 74 2e 74 6f 70 | 29 20 2f 0d 09 09 09 09 |Rect.top|) /.....|
|00004080| 09 20 20 20 74 65 2d 3e | 6c 69 6e 65 48 65 69 67 |. te->|lineHeig|
|00004090| 68 74 29 3b 0d 09 20 20 | 7d 0d 09 65 6c 73 65 20 |ht);.. |}..else |
|000040a0| 6d 61 78 20 3d 20 6b 4d | 61 78 44 6f 63 57 69 64 |max = kM|axDocWid|
|000040b0| 74 68 20 2d 20 28 74 65 | 2d 3e 76 69 65 77 52 65 |th - (te|->viewRe|
|000040c0| 63 74 2e 72 69 67 68 74 | 20 2d 20 74 65 2d 3e 76 |ct.right| - te->v|
|000040d0| 69 65 77 52 65 63 74 2e | 6c 65 66 74 29 3b 0d 0d |iewRect.|left);..|
|000040e0| 09 69 66 20 28 20 6d 61 | 78 20 3c 20 30 20 29 0d |.if ( ma|x < 0 ).|
|000040f0| 09 20 20 6d 61 78 20 3d | 20 30 3b 0d 09 53 65 74 |. max =| 0;..Set|
|00004100| 43 74 6c 4d 61 78 28 63 | 6f 6e 74 72 6f 6c 2c 20 |CtlMax(c|ontrol, |
|00004110| 6d 61 78 29 3b 0d 0d 09 | 2f 2f 20 4d 75 73 74 20 |max);...|// Must |
|00004120| 64 65 72 65 66 2e 20 61 | 66 74 65 72 20 53 65 74 |deref. a|fter Set|
|00004130| 43 74 6c 4d 61 78 20 73 | 69 6e 63 65 2c 20 74 65 |CtlMax s|ince, te|
|00004140| 63 68 6e 69 63 61 6c 6c | 79 2c 20 69 74 20 63 6f |chnicall|y, it co|
|00004150| 75 6c 64 20 64 72 61 77 | 20 61 6e 64 20 74 68 65 |uld draw| and the|
|00004160| 72 65 66 6f 72 65 20 6d | 6f 76 65 0d 09 2f 2f 20 |refore m|ove..// |
|00004170| 6d 65 6d 6f 72 79 2e 20 | 54 68 69 73 20 69 73 20 |memory. |This is |
|00004180| 77 68 79 20 77 65 20 64 | 6f 6e d5 74 20 6a 75 73 |why we d|on.t jus|
|00004190| 74 20 64 6f 20 69 74 20 | 6f 6e 63 65 20 61 74 20 |t do it |once at |
|000041a0| 74 68 65 20 62 65 67 69 | 6e 6e 69 6e 67 2e 0d 09 |the begi|nning...|
|000041b0| 74 65 20 3d 20 2a 66 44 | 6f 63 54 45 3b 0d 09 69 |te = *fD|ocTE;..i|
|000041c0| 66 20 28 20 69 73 56 65 | 72 74 20 29 0d 09 20 20 |f ( isVe|rt ).. |
|000041d0| 76 61 6c 75 65 20 3d 20 | 28 74 65 2d 3e 76 69 65 |value = |(te->vie|
|000041e0| 77 52 65 63 74 2e 74 6f | 70 20 2d 20 74 65 2d 3e |wRect.to|p - te->|
|000041f0| 64 65 73 74 52 65 63 74 | 2e 74 6f 70 29 20 2f 20 |destRect|.top) / |
|00004200| 74 65 2d 3e 6c 69 6e 65 | 48 65 69 67 68 74 3b 0d |te->line|Height;.|
|00004210| 09 65 6c 73 65 20 76 61 | 6c 75 65 20 3d 20 74 65 |.else va|lue = te|
|00004220| 2d 3e 76 69 65 77 52 65 | 63 74 2e 6c 65 66 74 20 |->viewRe|ct.left |
|00004230| 2d 20 74 65 2d 3e 64 65 | 73 74 52 65 63 74 2e 6c |- te->de|stRect.l|
|00004240| 65 66 74 3b 0d 0d 09 69 | 66 20 28 20 76 61 6c 75 |eft;...i|f ( valu|
|00004250| 65 20 3c 20 30 20 29 0d | 09 20 20 76 61 6c 75 65 |e < 0 ).|. value|
|00004260| 20 3d 20 30 3b 0d 09 65 | 6c 73 65 20 69 66 20 28 | = 0;..e|lse if (|
|00004270| 20 76 61 6c 75 65 20 3e | 20 20 6d 61 78 20 29 0d | value >| max ).|
|00004280| 09 20 20 76 61 6c 75 65 | 20 3d 20 6d 61 78 3b 0d |. value| = max;.|
|00004290| 0d 09 53 65 74 43 74 6c | 56 61 6c 75 65 28 63 6f |..SetCtl|Value(co|
|000042a0| 6e 74 72 6f 6c 2c 20 76 | 61 6c 75 65 29 3b 0d 09 |ntrol, v|alue);..|
|000042b0| 2f 2f 20 6e 6f 77 20 72 | 65 64 72 61 77 20 74 68 |// now r|edraw th|
|000042c0| 65 20 63 6f 6e 74 72 6f | 6c 20 69 66 20 61 73 6b |e contro|l if ask|
|000042d0| 65 64 20 74 6f 20 6f 72 | 20 69 66 20 61 20 73 65 |ed to or| if a se|
|000042e0| 74 74 69 6e 67 20 63 68 | 61 6e 67 65 64 0d 09 69 |tting ch|anged..i|
|000042f0| 66 20 28 20 6d 75 73 74 | 52 65 64 72 61 77 20 7c |f ( must|Redraw ||
|00004300| 7c 20 28 6d 61 78 20 21 | 3d 20 6f 6c 64 4d 61 78 || (max !|= oldMax|
|00004310| 29 20 7c 7c 20 28 76 61 | 6c 75 65 20 21 3d 20 6f |) || (va|lue != o|
|00004320| 6c 64 56 61 6c 75 65 29 | 20 29 0d 09 09 53 68 6f |ldValue)| )...Sho|
|00004330| 77 43 6f 6e 74 72 6f 6c | 28 63 6f 6e 74 72 6f 6c |wControl|(control|
|00004340| 29 3b 0d 7d 20 2f 2f 20 | 41 64 6a 75 73 74 48 56 |);.} // |AdjustHV|
|00004350| 0d 0d 2f 2f 20 53 69 6d | 70 6c 79 20 63 61 6c 6c |..// Sim|ply call|
|00004360| 20 74 68 65 20 63 6f 6d | 6d 6f 6e 20 61 64 6a 75 | the com|mon adju|
|00004370| 73 74 20 72 6f 75 74 69 | 6e 65 20 66 6f 72 20 74 |st routi|ne for t|
|00004380| 68 65 20 76 65 72 74 69 | 63 61 6c 20 61 6e 64 20 |he verti|cal and |
|00004390| 68 6f 72 69 7a 6f 6e 74 | 61 6c 20 73 63 72 6f 6c |horizont|al scrol|
|000043a0| 6c 62 61 72 73 2e 0d 0d | 76 6f 69 64 20 54 45 44 |lbars...|void TED|
|000043b0| 6f 63 75 6d 65 6e 74 3a | 3a 41 64 6a 75 73 74 53 |ocument:|:AdjustS|
|000043c0| 63 72 6f 6c 6c 56 61 6c | 75 65 73 28 42 6f 6f 6c |crollVal|ues(Bool|
|000043d0| 65 61 6e 20 6d 75 73 74 | 52 65 64 72 61 77 29 0d |ean must|Redraw).|
|000043e0| 7b 0d 09 41 64 6a 75 73 | 74 48 56 28 74 72 75 65 |{..Adjus|tHV(true|
|000043f0| 2c 20 6d 75 73 74 52 65 | 64 72 61 77 29 3b 0d 09 |, mustRe|draw);..|
|00004400| 41 64 6a 75 73 74 48 56 | 28 66 61 6c 73 65 2c 20 |AdjustHV|(false, |
|00004410| 6d 75 73 74 52 65 64 72 | 61 77 29 3b 0d 7d 20 2f |mustRedr|aw);.} /|
|00004420| 2f 20 41 64 6a 75 73 74 | 53 63 72 6f 6c 6c 56 61 |/ Adjust|ScrollVa|
|00004430| 6c 75 65 73 0d 0d 43 6c | 69 6b 4c 6f 6f 70 50 72 |lues..Cl|ikLoopPr|
|00004440| 6f 63 50 74 72 20 54 45 | 44 6f 63 75 6d 65 6e 74 |ocPtr TE|Document|
|00004450| 3a 3a 47 65 74 43 6c 69 | 6b 4c 6f 6f 70 28 29 0d |::GetCli|kLoop().|
|00004460| 7b 0d 09 72 65 74 75 72 | 6e 20 66 44 6f 63 43 6c |{..retur|n fDocCl|
|00004470| 69 6b 3b 0d 7d 0d 0d 54 | 45 48 61 6e 64 6c 65 20 |ik;.}..T|EHandle |
|00004480| 54 45 44 6f 63 75 6d 65 | 6e 74 3a 3a 47 65 74 54 |TEDocume|nt::GetT|
|00004490| 45 48 61 6e 64 6c 65 28 | 29 0d 7b 0d 09 72 65 74 |EHandle(|).{..ret|
|000044a0| 75 72 6e 20 66 44 6f 63 | 54 45 3b 0d 7d 0d 0d 76 |urn fDoc|TE;.}..v|
|000044b0| 6f 69 64 20 54 45 44 6f | 63 75 6d 65 6e 74 3a 3a |oid TEDo|cument::|
|000044c0| 44 6f 43 75 74 28 29 0d | 7b 0d 09 6c 6f 6e 67 20 |DoCut().|{..long |
|000044d0| 74 6f 74 61 6c 2c 20 63 | 6f 6e 74 69 67 3b 0d 0d |total, c|ontig;..|
|000044e0| 09 69 66 20 28 5a 65 72 | 6f 53 63 72 61 70 28 29 |.if (Zer|oScrap()|
|000044f0| 20 3d 3d 20 6e 6f 45 72 | 72 29 0d 09 20 20 7b 0d | == noEr|r).. {.|
|00004500| 09 09 50 75 72 67 65 53 | 70 61 63 65 28 26 74 6f |..PurgeS|pace(&to|
|00004510| 74 61 6c 2c 20 26 63 6f | 6e 74 69 67 29 3b 0d 09 |tal, &co|ntig);..|
|00004520| 09 69 66 20 28 28 2a 66 | 44 6f 63 54 45 29 2d 3e |.if ((*f|DocTE)->|
|00004530| 73 65 6c 45 6e 64 20 2d | 20 28 2a 66 44 6f 63 54 |selEnd -| (*fDocT|
|00004540| 45 29 2d 3e 73 65 6c 53 | 74 61 72 74 20 2b 20 6b |E)->selS|tart + k|
|00004550| 54 45 53 6c 6f 70 20 3e | 20 63 6f 6e 74 69 67 29 |TESlop >| contig)|
|00004560| 0d 09 09 20 20 46 61 69 | 6c 75 72 65 28 65 4e 6f |... Fai|lure(eNo|
|00004570| 53 70 61 63 65 43 75 74 | 2c 6b 54 45 44 6f 63 45 |SpaceCut|,kTEDocE|
|00004580| 72 72 53 74 72 69 6e 67 | 73 29 3b 0d 0d 09 09 54 |rrString|s);....T|
|00004590| 45 43 75 74 28 66 44 6f | 63 54 45 29 3b 0d 09 09 |ECut(fDo|cTE);...|
|000045a0| 66 44 69 72 74 79 20 3d | 20 74 72 75 65 3b 0d 09 |fDirty =| true;..|
|000045b0| 09 69 66 20 28 54 45 54 | 6f 53 63 72 61 70 28 29 |.if (TET|oScrap()|
|000045c0| 20 21 3d 20 6e 6f 45 72 | 72 29 0d 09 09 20 20 7b | != noEr|r)... {|
|000045d0| 0d 09 09 09 28 76 6f 69 | 64 29 20 5a 65 72 6f 53 |....(voi|d) ZeroS|
|000045e0| 63 72 61 70 28 29 3b 0d | 09 09 09 46 61 69 6c 75 |crap();.|...Failu|
|000045f0| 72 65 28 65 4e 6f 43 75 | 74 2c 6b 54 45 44 6f 63 |re(eNoCu|t,kTEDoc|
|00004600| 45 72 72 53 74 72 69 6e | 67 73 29 3b 0d 09 09 20 |ErrStrin|gs);... |
|00004610| 20 7d 0d 09 20 20 7d 0d | 09 41 64 6a 75 73 74 53 | }.. }.|.AdjustS|
|00004620| 63 72 6f 6c 6c 62 61 72 | 73 28 66 61 6c 73 65 29 |crollbar|s(false)|
|00004630| 3b 0d 09 41 64 6a 75 73 | 74 54 45 28 29 3b 0d 7d |;..Adjus|tTE();.}|
|00004640| 0d 0d 76 6f 69 64 20 54 | 45 44 6f 63 75 6d 65 6e |..void T|EDocumen|
|00004650| 74 3a 3a 44 6f 43 6f 70 | 79 28 29 0d 7b 0d 09 69 |t::DoCop|y().{..i|
|00004660| 66 20 28 5a 65 72 6f 53 | 63 72 61 70 28 29 20 3d |f (ZeroS|crap() =|
|00004670| 3d 20 6e 6f 45 72 72 29 | 0d 09 20 20 7b 0d 09 09 |= noErr)|.. {...|
|00004680| 54 45 43 6f 70 79 28 66 | 44 6f 63 54 45 29 3b 09 |TECopy(f|DocTE);.|
|00004690| 09 09 09 2f 2f 20 61 66 | 74 65 72 20 63 6f 70 79 |...// af|ter copy|
|000046a0| 69 6e 67 2c 20 65 78 70 | 6f 72 74 20 74 68 65 20 |ing, exp|ort the |
|000046b0| 54 45 20 73 63 72 61 70 | 0d 09 09 69 66 20 28 54 |TE scrap|...if (T|
|000046c0| 45 54 6f 53 63 72 61 70 | 28 29 20 21 3d 20 6e 6f |EToScrap|() != no|
|000046d0| 45 72 72 29 0d 09 09 20 | 20 7b 0d 09 09 09 5a 65 |Err)... | {....Ze|
|000046e0| 72 6f 53 63 72 61 70 28 | 29 3b 0d 09 09 09 46 61 |roScrap(|);....Fa|
|000046f0| 69 6c 75 72 65 28 65 4e | 6f 43 6f 70 79 2c 6b 54 |ilure(eN|oCopy,kT|
|00004700| 45 44 6f 63 45 72 72 53 | 74 72 69 6e 67 73 29 3b |EDocErrS|trings);|
|00004710| 0d 09 09 20 20 7d 0d 09 | 20 20 7d 0d 09 41 64 6a |... }..| }..Adj|
|00004720| 75 73 74 53 63 72 6f 6c | 6c 62 61 72 73 28 66 61 |ustScrol|lbars(fa|
|00004730| 6c 73 65 29 3b 0d 09 41 | 64 6a 75 73 74 54 45 28 |lse);..A|djustTE(|
|00004740| 29 3b 0d 7d 0d 0d 76 6f | 69 64 20 54 45 44 6f 63 |);.}..vo|id TEDoc|
|00004750| 75 6d 65 6e 74 3a 3a 44 | 6f 50 61 73 74 65 28 29 |ument::D|oPaste()|
|00004760| 0d 7b 0d 09 48 61 6e 64 | 6c 65 20 61 48 61 6e 64 |.{..Hand|le aHand|
|00004770| 6c 65 3b 0d 09 6c 6f 6e | 67 20 6f 6c 64 53 69 7a |le;..lon|g oldSiz|
|00004780| 65 2c 20 6e 65 77 53 69 | 7a 65 3b 0d 09 4f 53 45 |e, newSi|ze;..OSE|
|00004790| 72 72 20 73 61 76 65 45 | 72 72 3b 0d 0d 09 69 66 |rr saveE|rr;...if|
|000047a0| 20 28 54 45 46 72 6f 6d | 53 63 72 61 70 28 29 20 | (TEFrom|Scrap() |
|000047b0| 21 3d 20 6e 6f 45 72 72 | 29 0d 09 20 20 46 61 69 |!= noErr|).. Fai|
|000047c0| 6c 75 72 65 28 65 4e 6f | 50 61 73 74 65 2c 6b 54 |lure(eNo|Paste,kT|
|000047d0| 45 44 6f 63 45 72 72 53 | 74 72 69 6e 67 73 29 3b |EDocErrS|trings);|
|000047e0| 0d 0d 09 69 66 20 28 20 | 54 45 47 65 74 53 63 72 |...if ( |TEGetScr|
|000047f0| 61 70 4c 65 6e 28 29 20 | 2b 20 28 28 2a 66 44 6f |apLen() |+ ((*fDo|
|00004800| 63 54 45 29 2d 3e 74 65 | 4c 65 6e 67 74 68 20 2d |cTE)->te|Length -|
|00004810| 0d 09 09 20 28 28 2a 66 | 44 6f 63 54 45 29 2d 3e |... ((*f|DocTE)->|
|00004820| 73 65 6c 45 6e 64 20 2d | 20 28 2a 66 44 6f 63 54 |selEnd -| (*fDocT|
|00004830| 45 29 2d 3e 73 65 6c 53 | 74 61 72 74 29 29 20 3e |E)->selS|tart)) >|
|00004840| 20 6b 4d 61 78 54 45 4c | 65 6e 67 74 68 20 29 0d | kMaxTEL|ength ).|
|00004850| 09 20 20 46 61 69 6c 75 | 72 65 28 65 45 78 63 65 |. Failu|re(eExce|
|00004860| 65 64 50 61 73 74 65 2c | 6b 54 45 44 6f 63 45 72 |edPaste,|kTEDocEr|
|00004870| 72 53 74 72 69 6e 67 73 | 29 3b 0d 0d 09 61 48 61 |rStrings|);...aHa|
|00004880| 6e 64 6c 65 20 3d 20 28 | 48 61 6e 64 6c 65 29 20 |ndle = (|Handle) |
|00004890| 54 45 47 65 74 54 65 78 | 74 28 66 44 6f 63 54 45 |TEGetTex|t(fDocTE|
|000048a0| 29 3b 0d 09 6f 6c 64 53 | 69 7a 65 20 3d 20 47 65 |);..oldS|ize = Ge|
|000048b0| 74 48 61 6e 64 6c 65 53 | 69 7a 65 28 61 48 61 6e |tHandleS|ize(aHan|
|000048c0| 64 6c 65 29 3b 0d 09 6e | 65 77 53 69 7a 65 20 3d |dle);..n|ewSize =|
|000048d0| 20 6f 6c 64 53 69 7a 65 | 20 2b 20 54 45 47 65 74 | oldSize| + TEGet|
|000048e0| 53 63 72 61 70 4c 65 6e | 28 29 20 2b 20 6b 54 45 |ScrapLen|() + kTE|
|000048f0| 53 6c 6f 70 3b 0d 0d 09 | 2f 2f 20 70 72 65 66 6c |Slop;...|// prefl|
|00004900| 69 67 68 74 20 74 68 65 | 20 67 72 6f 77 74 68 20 |ight the| growth |
|00004910| 6f 66 20 74 68 65 20 74 | 65 78 74 20 68 61 6e 64 |of the t|ext hand|
|00004920| 6c 65 20 66 6f 72 20 74 | 65 78 74 65 64 69 74 2c |le for t|extedit,|
|00004930| 0d 09 2f 2f 20 73 69 6e | 63 65 20 69 74 20 77 69 |..// sin|ce it wi|
|00004940| 6c 6c 20 63 72 61 73 68 | 20 69 66 20 69 74 20 64 |ll crash| if it d|
|00004950| 6f 65 73 6e 27 74 20 68 | 61 76 65 20 65 6e 6f 75 |oesn't h|ave enou|
|00004960| 67 68 20 6d 65 6d 6f 72 | 79 0d 09 53 65 74 48 61 |gh memor|y..SetHa|
|00004970| 6e 64 6c 65 53 69 7a 65 | 28 61 48 61 6e 64 6c 65 |ndleSize|(aHandle|
|00004980| 2c 20 6e 65 77 53 69 7a | 65 29 3b 0d 09 73 61 76 |, newSiz|e);..sav|
|00004990| 65 45 72 72 20 3d 20 4d | 65 6d 45 72 72 6f 72 28 |eErr = M|emError(|
|000049a0| 29 3b 0d 09 53 65 74 48 | 61 6e 64 6c 65 53 69 7a |);..SetH|andleSiz|
|000049b0| 65 28 61 48 61 6e 64 6c | 65 2c 20 6f 6c 64 53 69 |e(aHandl|e, oldSi|
|000049c0| 7a 65 29 3b 0d 09 69 66 | 20 28 73 61 76 65 45 72 |ze);..if| (saveEr|
|000049d0| 72 20 21 3d 20 6e 6f 45 | 72 72 29 0d 09 20 20 46 |r != noE|rr).. F|
|000049e0| 61 69 6c 75 72 65 28 65 | 4e 6f 53 70 61 63 65 50 |ailure(e|NoSpaceP|
|000049f0| 61 73 74 65 2c 6b 54 45 | 44 6f 63 45 72 72 53 74 |aste,kTE|DocErrSt|
|00004a00| 72 69 6e 67 73 29 3b 0d | 0d 09 54 45 50 61 73 74 |rings);.|..TEPast|
|00004a10| 65 28 66 44 6f 63 54 45 | 29 3b 0d 09 66 44 69 72 |e(fDocTE|);..fDir|
|00004a20| 74 79 20 3d 20 74 72 75 | 65 3b 0d 0d 09 41 64 6a |ty = tru|e;...Adj|
|00004a30| 75 73 74 53 63 72 6f 6c | 6c 62 61 72 73 28 66 61 |ustScrol|lbars(fa|
|00004a40| 6c 73 65 29 3b 0d 09 41 | 64 6a 75 73 74 54 45 28 |lse);..A|djustTE(|
|00004a50| 29 3b 0d 7d 0d 0d 76 6f | 69 64 20 54 45 44 6f 63 |);.}..vo|id TEDoc|
|00004a60| 75 6d 65 6e 74 3a 3a 44 | 6f 43 6c 65 61 72 28 29 |ument::D|oClear()|
|00004a70| 0d 7b 0d 09 54 45 44 65 | 6c 65 74 65 28 66 44 6f |.{..TEDe|lete(fDo|
|00004a80| 63 54 45 29 3b 0d 09 66 | 44 69 72 74 79 20 3d 20 |cTE);..f|Dirty = |
|00004a90| 74 72 75 65 3b 0d 09 41 | 64 6a 75 73 74 53 63 72 |true;..A|djustScr|
|00004aa0| 6f 6c 6c 62 61 72 73 28 | 66 61 6c 73 65 29 3b 0d |ollbars(|false);.|
|00004ab0| 09 41 64 6a 75 73 74 54 | 45 28 29 3b 0d 7d 0d 0d |.AdjustT|E();.}..|
|00004ac0| 76 6f 69 64 20 54 45 44 | 6f 63 75 6d 65 6e 74 3a |void TED|ocument:|
|00004ad0| 3a 44 6f 53 65 6c 65 63 | 74 41 6c 6c 28 29 0d 7b |:DoSelec|tAll().{|
|00004ae0| 0d 09 6c 6f 6e 67 20 73 | 65 6c 53 69 7a 65 20 3d |..long s|elSize =|
|00004af0| 20 28 2a 66 44 6f 63 54 | 45 29 2d 3e 74 65 4c 65 | (*fDocT|E)->teLe|
|00004b00| 6e 67 74 68 3b 0d 09 54 | 45 53 65 74 53 65 6c 65 |ngth;..T|ESetSele|
|00004b10| 63 74 28 30 2c 73 65 6c | 53 69 7a 65 2c 66 44 6f |ct(0,sel|Size,fDo|
|00004b20| 63 54 45 29 3b 0d 7d 0d | 0d 2f 2a 0d 09 52 6f 75 |cTE);.}.|./*..Rou|
|00004b30| 74 69 6e 65 73 20 75 73 | 65 64 20 62 79 20 74 68 |tines us|ed by th|
|00004b40| 69 73 20 63 6c 61 73 73 | 2c 20 77 68 69 63 68 20 |is class|, which |
|00004b50| 64 6f 6e 27 74 20 62 65 | 6c 6f 6e 67 20 74 6f 20 |don't be|long to |
|00004b60| 74 68 65 20 63 6c 61 73 | 73 20 73 69 6e 63 65 20 |the clas|s since |
|00004b70| 77 65 20 75 73 65 0d 09 | 74 68 65 6d 20 61 73 20 |we use..|them as |
|00004b80| 74 6f 6f 6c 62 6f 78 20 | 66 69 6c 74 65 72 20 72 |toolbox |filter r|
|00004b90| 6f 75 74 69 6e 65 73 2c | 20 61 6e 64 20 79 6f 75 |outines,| and you|
|00004ba0| 20 63 61 6e 6e 6f 74 20 | 70 61 73 73 20 63 6c 61 | cannot |pass cla|
|00004bb0| 73 73 20 6d 65 74 68 6f | 64 73 20 61 73 20 50 72 |ss metho|ds as Pr|
|00004bc0| 6f 63 50 74 72 73 2e 0d | 2a 2f 0d 0d 2f 2f 20 77 |ocPtrs..|*/..// w|
|00004bd0| 65 20 72 65 66 65 72 20 | 62 61 63 6b 20 74 6f 20 |e refer |back to |
|00004be0| 74 68 65 20 6f 77 6e 69 | 6e 67 20 61 70 70 6c 69 |the owni|ng appli|
|00004bf0| 63 61 74 69 6f 6e 20 73 | 6f 20 74 68 61 74 20 77 |cation s|o that w|
|00004c00| 65 20 63 61 6e 20 67 65 | 74 20 61 63 63 65 73 73 |e can ge|t access|
|00004c10| 20 74 6f 0d 2f 2f 20 74 | 68 65 20 64 6f 63 75 6d | to.// t|he docum|
|00004c20| 65 6e 74 20 6c 69 73 74 | 2c 20 74 6f 20 66 69 6e |ent list|, to fin|
|00004c30| 64 20 74 68 65 20 63 75 | 72 72 65 6e 74 20 64 6f |d the cu|rrent do|
|00004c40| 63 75 6d 65 6e 74 20 6f | 62 6a 65 63 74 2e 0d 65 |cument o|bject..e|
|00004c50| 78 74 65 72 6e 20 54 45 | 53 61 6d 70 6c 65 2a 20 |xtern TE|Sample* |
|00004c60| 67 54 68 65 41 70 70 6c | 69 63 61 74 69 6f 6e 3b |gTheAppl|ication;|
|00004c70| 0d 0d 2f 2f 20 43 6f 6d | 6d 6f 6e 20 61 6c 67 6f |..// Com|mon algo|
|00004c80| 72 69 74 68 6d 20 66 6f | 72 20 70 69 6e 6e 69 6e |rithm fo|r pinnin|
|00004c90| 67 20 74 68 65 20 76 61 | 6c 75 65 20 6f 66 20 61 |g the va|lue of a|
|00004ca0| 20 63 6f 6e 74 72 6f 6c | 2e 20 49 74 20 72 65 74 | control|. It ret|
|00004cb0| 75 72 6e 73 20 74 68 65 | 20 61 63 74 75 61 6c 20 |urns the| actual |
|00004cc0| 61 6d 6f 75 6e 74 0d 2f | 2f 20 74 68 65 20 76 61 |amount./|/ the va|
|00004cd0| 6c 75 65 20 6f 66 20 74 | 68 65 20 63 6f 6e 74 72 |lue of t|he contr|
|00004ce0| 6f 6c 20 63 68 61 6e 67 | 65 64 2e 0d 0d 76 6f 69 |ol chang|ed...voi|
|00004cf0| 64 20 43 6f 6d 6d 6f 6e | 41 63 74 69 6f 6e 28 43 |d Common|Action(C|
|00004d00| 6f 6e 74 72 6f 6c 48 61 | 6e 64 6c 65 20 63 6f 6e |ontrolHa|ndle con|
|00004d10| 74 72 6f 6c 2c 73 68 6f | 72 74 2a 20 61 6d 6f 75 |trol,sho|rt* amou|
|00004d20| 6e 74 29 0d 7b 0d 09 73 | 68 6f 72 74 09 09 76 61 |nt).{..s|hort..va|
|00004d30| 6c 75 65 2c 20 6d 61 78 | 3b 0d 0d 09 76 61 6c 75 |lue, max|;...valu|
|00004d40| 65 20 3d 20 47 65 74 43 | 74 6c 56 61 6c 75 65 28 |e = GetC|tlValue(|
|00004d50| 63 6f 6e 74 72 6f 6c 29 | 3b 0d 09 6d 61 78 20 3d |control)|;..max =|
|00004d60| 20 47 65 74 43 74 6c 4d | 61 78 28 63 6f 6e 74 72 | GetCtlM|ax(contr|
|00004d70| 6f 6c 29 3b 0d 09 2a 61 | 6d 6f 75 6e 74 20 3d 20 |ol);..*a|mount = |
|00004d80| 76 61 6c 75 65 20 2d 20 | 2a 61 6d 6f 75 6e 74 3b |value - |*amount;|
|00004d90| 0d 09 69 66 20 28 20 2a | 61 6d 6f 75 6e 74 20 3c |..if ( *|amount <|
|00004da0| 3d 20 30 20 29 0d 09 09 | 2a 61 6d 6f 75 6e 74 20 |= 0 )...|*amount |
|00004db0| 3d 20 30 3b 0d 09 65 6c | 73 65 20 69 66 20 28 20 |= 0;..el|se if ( |
|00004dc0| 2a 61 6d 6f 75 6e 74 20 | 3e 3d 20 6d 61 78 20 29 |*amount |>= max )|
|00004dd0| 0d 09 09 2a 61 6d 6f 75 | 6e 74 20 3d 20 6d 61 78 |...*amou|nt = max|
|00004de0| 3b 0d 09 53 65 74 43 74 | 6c 56 61 6c 75 65 28 63 |;..SetCt|lValue(c|
|00004df0| 6f 6e 74 72 6f 6c 2c 20 | 2a 61 6d 6f 75 6e 74 29 |ontrol, |*amount)|
|00004e00| 3b 0d 09 2a 61 6d 6f 75 | 6e 74 20 3d 20 76 61 6c |;..*amou|nt = val|
|00004e10| 75 65 20 2d 20 2a 61 6d | 6f 75 6e 74 3b 0d 7d 20 |ue - *am|ount;.} |
|00004e20| 2f 2f 20 43 6f 6d 6d 6f | 6e 41 63 74 69 6f 6e 0d |// Commo|nAction.|
|00004e30| 0d 0d 2f 2f 20 44 65 74 | 65 72 6d 69 6e 65 73 20 |..// Det|ermines |
|00004e40| 68 6f 77 20 6d 75 63 68 | 20 74 6f 20 63 68 61 6e |how much| to chan|
|00004e50| 67 65 20 74 68 65 20 76 | 61 6c 75 65 20 6f 66 20 |ge the v|alue of |
|00004e60| 74 68 65 20 76 65 72 74 | 69 63 61 6c 20 73 63 72 |the vert|ical scr|
|00004e70| 6f 6c 6c 62 61 72 20 62 | 79 20 61 6e 64 20 68 6f |ollbar b|y and ho|
|00004e80| 77 0d 2f 2f 20 6d 75 63 | 68 20 74 6f 20 73 63 72 |w.// muc|h to scr|
|00004e90| 6f 6c 6c 20 74 68 65 20 | 54 45 20 72 65 63 6f 72 |oll the |TE recor|
|00004ea0| 64 2e 0d 0d 70 61 73 63 | 61 6c 20 76 6f 69 64 20 |d...pasc|al void |
|00004eb0| 56 41 63 74 69 6f 6e 50 | 72 6f 63 28 43 6f 6e 74 |VActionP|roc(Cont|
|00004ec0| 72 6f 6c 48 61 6e 64 6c | 65 20 63 6f 6e 74 72 6f |rolHandl|e contro|
|00004ed0| 6c 2c 73 68 6f 72 74 20 | 70 61 72 74 29 0d 7b 0d |l,short |part).{.|
|00004ee0| 09 73 68 6f 72 74 09 09 | 61 6d 6f 75 6e 74 3b 0d |.short..|amount;.|
|00004ef0| 09 57 69 6e 64 6f 77 50 | 74 72 09 77 69 6e 64 6f |.WindowP|tr.windo|
|00004f00| 77 3b 0d 09 54 45 50 74 | 72 09 09 74 65 3b 0d 09 |w;..TEPt|r..te;..|
|00004f10| 54 45 44 6f 63 75 6d 65 | 6e 74 2a 20 64 6f 63 3b |TEDocume|nt* doc;|
|00004f20| 0d 0d 09 69 66 20 28 20 | 70 61 72 74 20 21 3d 20 |...if ( |part != |
|00004f30| 30 20 29 0d 09 20 20 7b | 0d 09 09 77 69 6e 64 6f |0 ).. {|...windo|
|00004f40| 77 20 3d 20 28 2a 63 6f | 6e 74 72 6f 6c 29 2d 3e |w = (*co|ntrol)->|
|00004f50| 63 6f 6e 74 72 6c 4f 77 | 6e 65 72 3b 0d 09 09 64 |contrlOw|ner;...d|
|00004f60| 6f 63 20 3d 20 28 54 45 | 44 6f 63 75 6d 65 6e 74 |oc = (TE|Document|
|00004f70| 2a 29 20 28 67 54 68 65 | 41 70 70 6c 69 63 61 74 |*) (gThe|Applicat|
|00004f80| 69 6f 6e 2d 3e 44 6f 63 | 4c 69 73 74 28 29 29 2d |ion->Doc|List())-|
|00004f90| 3e 46 69 6e 64 44 6f 63 | 28 77 69 6e 64 6f 77 29 |>FindDoc|(window)|
|00004fa0| 3b 0d 09 09 74 65 20 3d | 20 2a 28 64 6f 63 2d 3e |;...te =| *(doc->|
|00004fb0| 47 65 74 54 45 48 61 6e | 64 6c 65 28 29 29 3b 0d |GetTEHan|dle());.|
|00004fc0| 09 09 73 77 69 74 63 68 | 20 28 20 70 61 72 74 20 |..switch| ( part |
|00004fd0| 29 0d 09 09 20 20 7b 0d | 09 09 09 63 61 73 65 20 |)... {.|...case |
|00004fe0| 69 6e 55 70 42 75 74 74 | 6f 6e 3a 0d 09 09 09 63 |inUpButt|on:....c|
|00004ff0| 61 73 65 20 69 6e 44 6f | 77 6e 42 75 74 74 6f 6e |ase inDo|wnButton|
|00005000| 3a 09 09 2f 2f 20 6f 6e | 65 20 6c 69 6e 65 0d 09 |:..// on|e line..|
|00005010| 09 09 09 61 6d 6f 75 6e | 74 20 3d 20 31 3b 0d 09 |...amoun|t = 1;..|
|00005020| 09 09 09 62 72 65 61 6b | 3b 0d 09 09 09 63 61 73 |...break|;....cas|
|00005030| 65 20 69 6e 50 61 67 65 | 55 70 3a 09 09 09 2f 2f |e inPage|Up:...//|
|00005040| 20 6f 6e 65 20 70 61 67 | 65 0d 09 09 09 63 61 73 | one pag|e....cas|
|00005050| 65 20 69 6e 50 61 67 65 | 44 6f 77 6e 3a 0d 09 09 |e inPage|Down:...|
|00005060| 09 09 61 6d 6f 75 6e 74 | 20 3d 20 28 74 65 2d 3e |..amount| = (te->|
|00005070| 76 69 65 77 52 65 63 74 | 2e 62 6f 74 74 6f 6d 20 |viewRect|.bottom |
|00005080| 2d 20 74 65 2d 3e 76 69 | 65 77 52 65 63 74 2e 74 |- te->vi|ewRect.t|
|00005090| 6f 70 29 20 2f 20 74 65 | 2d 3e 6c 69 6e 65 48 65 |op) / te|->lineHe|
|000050a0| 69 67 68 74 3b 0d 09 09 | 09 09 62 72 65 61 6b 3b |ight;...|..break;|
|000050b0| 0d 09 09 20 20 7d 0d 09 | 09 69 66 20 28 20 28 70 |... }..|.if ( (p|
|000050c0| 61 72 74 20 3d 3d 20 69 | 6e 44 6f 77 6e 42 75 74 |art == i|nDownBut|
|000050d0| 74 6f 6e 29 20 7c 7c 20 | 28 70 61 72 74 20 3d 3d |ton) || |(part ==|
|000050e0| 20 69 6e 50 61 67 65 44 | 6f 77 6e 29 20 29 0d 09 | inPageD|own) )..|
|000050f0| 09 09 61 6d 6f 75 6e 74 | 20 3d 20 2d 61 6d 6f 75 |..amount| = -amou|
|00005100| 6e 74 3b 09 09 2f 2f 20 | 72 65 76 65 72 73 65 20 |nt;..// |reverse |
|00005110| 64 69 72 65 63 74 69 6f | 6e 20 66 6f 72 20 61 20 |directio|n for a |
|00005120| 64 6f 77 6e 65 72 0d 09 | 09 43 6f 6d 6d 6f 6e 41 |downer..|.CommonA|
|00005130| 63 74 69 6f 6e 28 63 6f | 6e 74 72 6f 6c 2c 20 26 |ction(co|ntrol, &|
|00005140| 61 6d 6f 75 6e 74 29 3b | 0d 09 09 69 66 20 28 20 |amount);|...if ( |
|00005150| 61 6d 6f 75 6e 74 20 21 | 3d 20 30 20 29 0d 09 09 |amount !|= 0 )...|
|00005160| 09 54 45 53 63 72 6f 6c | 6c 28 30 2c 20 61 6d 6f |.TEScrol|l(0, amo|
|00005170| 75 6e 74 20 2a 20 74 65 | 2d 3e 6c 69 6e 65 48 65 |unt * te|->lineHe|
|00005180| 69 67 68 74 2c 20 64 6f | 63 2d 3e 47 65 74 54 45 |ight, do|c->GetTE|
|00005190| 48 61 6e 64 6c 65 28 29 | 29 3b 0d 09 20 20 7d 0d |Handle()|);.. }.|
|000051a0| 7d 20 2f 2f 20 56 41 63 | 74 69 6f 6e 50 72 6f 63 |} // VAc|tionProc|
|000051b0| 0d 0d 2f 2f 20 44 65 74 | 65 72 6d 69 6e 65 73 20 |..// Det|ermines |
|000051c0| 68 6f 77 20 6d 75 63 68 | 20 74 6f 20 63 68 61 6e |how much| to chan|
|000051d0| 67 65 20 74 68 65 20 76 | 61 6c 75 65 20 6f 66 20 |ge the v|alue of |
|000051e0| 74 68 65 20 68 6f 72 69 | 7a 6f 6e 74 61 6c 20 73 |the hori|zontal s|
|000051f0| 63 72 6f 6c 6c 62 61 72 | 20 62 79 20 61 6e 64 20 |crollbar| by and |
|00005200| 68 6f 77 0d 2f 2f 20 6d | 75 63 68 20 74 6f 20 73 |how.// m|uch to s|
|00005210| 63 72 6f 6c 6c 20 74 68 | 65 20 54 45 20 72 65 63 |croll th|e TE rec|
|00005220| 6f 72 64 2e 0d 0d 70 61 | 73 63 61 6c 20 76 6f 69 |ord...pa|scal voi|
|00005230| 64 20 48 41 63 74 69 6f | 6e 50 72 6f 63 28 43 6f |d HActio|nProc(Co|
|00005240| 6e 74 72 6f 6c 48 61 6e | 64 6c 65 20 63 6f 6e 74 |ntrolHan|dle cont|
|00005250| 72 6f 6c 2c 73 68 6f 72 | 74 20 70 61 72 74 29 0d |rol,shor|t part).|
|00005260| 7b 0d 09 73 68 6f 72 74 | 09 09 61 6d 6f 75 6e 74 |{..short|..amount|
|00005270| 3b 0d 09 57 69 6e 64 6f | 77 50 74 72 09 77 69 6e |;..Windo|wPtr.win|
|00005280| 64 6f 77 3b 0d 09 54 45 | 50 74 72 09 09 74 65 3b |dow;..TE|Ptr..te;|
|00005290| 0d 09 54 45 44 6f 63 75 | 6d 65 6e 74 2a 20 64 6f |..TEDocu|ment* do|
|000052a0| 63 3b 0d 0d 09 69 66 20 | 28 20 70 61 72 74 20 21 |c;...if |( part !|
|000052b0| 3d 20 30 20 29 0d 09 20 | 20 7b 0d 09 09 77 69 6e |= 0 ).. | {...win|
|000052c0| 64 6f 77 20 3d 20 28 2a | 63 6f 6e 74 72 6f 6c 29 |dow = (*|control)|
|000052d0| 2d 3e 63 6f 6e 74 72 6c | 4f 77 6e 65 72 3b 0d 09 |->contrl|Owner;..|
|000052e0| 09 64 6f 63 20 3d 20 28 | 54 45 44 6f 63 75 6d 65 |.doc = (|TEDocume|
|000052f0| 6e 74 2a 29 20 28 67 54 | 68 65 41 70 70 6c 69 63 |nt*) (gT|heApplic|
|00005300| 61 74 69 6f 6e 2d 3e 44 | 6f 63 4c 69 73 74 28 29 |ation->D|ocList()|
|00005310| 29 2d 3e 46 69 6e 64 44 | 6f 63 28 77 69 6e 64 6f |)->FindD|oc(windo|
|00005320| 77 29 3b 0d 09 09 74 65 | 20 3d 20 2a 28 64 6f 63 |w);...te| = *(doc|
|00005330| 2d 3e 47 65 74 54 45 48 | 61 6e 64 6c 65 28 29 29 |->GetTEH|andle())|
|00005340| 3b 0d 09 09 73 77 69 74 | 63 68 20 28 20 70 61 72 |;...swit|ch ( par|
|00005350| 74 20 29 0d 09 09 20 20 | 7b 0d 09 09 09 63 61 73 |t )... |{....cas|
|00005360| 65 20 69 6e 55 70 42 75 | 74 74 6f 6e 3a 0d 09 09 |e inUpBu|tton:...|
|00005370| 09 63 61 73 65 20 69 6e | 44 6f 77 6e 42 75 74 74 |.case in|DownButt|
|00005380| 6f 6e 3a 09 09 2f 2f 20 | 61 20 66 65 77 20 70 69 |on:..// |a few pi|
|00005390| 78 65 6c 73 0d 09 09 09 | 09 61 6d 6f 75 6e 74 20 |xels....|.amount |
|000053a0| 3d 20 34 3b 0d 09 09 09 | 09 62 72 65 61 6b 3b 0d |= 4;....|.break;.|
|000053b0| 09 09 09 63 61 73 65 20 | 69 6e 50 61 67 65 55 70 |...case |inPageUp|
|000053c0| 3a 09 09 09 2f 2f 20 61 | 20 70 61 67 65 0d 09 09 |:...// a| page...|
|000053d0| 09 63 61 73 65 20 69 6e | 50 61 67 65 44 6f 77 6e |.case in|PageDown|
|000053e0| 3a 0d 09 09 09 09 61 6d | 6f 75 6e 74 20 3d 20 74 |:.....am|ount = t|
|000053f0| 65 2d 3e 76 69 65 77 52 | 65 63 74 2e 72 69 67 68 |e->viewR|ect.righ|
|00005400| 74 20 2d 20 74 65 2d 3e | 76 69 65 77 52 65 63 74 |t - te->|viewRect|
|00005410| 2e 6c 65 66 74 3b 0d 09 | 09 09 09 62 72 65 61 6b |.left;..|...break|
|00005420| 3b 0d 09 09 20 20 7d 0d | 09 09 69 66 20 28 20 28 |;... }.|..if ( (|
|00005430| 70 61 72 74 20 3d 3d 20 | 69 6e 44 6f 77 6e 42 75 |part == |inDownBu|
|00005440| 74 74 6f 6e 29 20 7c 7c | 20 28 70 61 72 74 20 3d |tton) ||| (part =|
|00005450| 3d 20 69 6e 50 61 67 65 | 44 6f 77 6e 29 20 29 0d |= inPage|Down) ).|
|00005460| 09 09 09 61 6d 6f 75 6e | 74 20 3d 20 2d 61 6d 6f |...amoun|t = -amo|
|00005470| 75 6e 74 3b 09 09 2f 2f | 20 72 65 76 65 72 73 65 |unt;..//| reverse|
|00005480| 20 64 69 72 65 63 74 69 | 6f 6e 0d 09 09 43 6f 6d | directi|on...Com|
|00005490| 6d 6f 6e 41 63 74 69 6f | 6e 28 63 6f 6e 74 72 6f |monActio|n(contro|
|000054a0| 6c 2c 20 26 61 6d 6f 75 | 6e 74 29 3b 0d 09 09 69 |l, &amou|nt);...i|
|000054b0| 66 20 28 20 61 6d 6f 75 | 6e 74 20 21 3d 20 30 20 |f ( amou|nt != 0 |
|000054c0| 29 0d 09 09 09 54 45 53 | 63 72 6f 6c 6c 28 61 6d |)....TES|croll(am|
|000054d0| 6f 75 6e 74 2c 20 30 2c | 20 64 6f 63 2d 3e 47 65 |ount, 0,| doc->Ge|
|000054e0| 74 54 45 48 61 6e 64 6c | 65 28 29 29 3b 0d 09 20 |tTEHandl|e());.. |
|000054f0| 20 7d 0d 7d 20 2f 2f 20 | 56 41 63 74 69 6f 6e 50 | }.} // |VActionP|
|00005500| 72 6f 63 0d 0d 2f 2f 20 | 47 65 74 73 20 63 61 6c |roc..// |Gets cal|
|00005510| 6c 65 64 20 66 72 6f 6d | 20 6f 75 72 20 61 73 73 |led from| our ass|
|00005520| 65 6d 62 6c 79 20 6c 61 | 6e 67 75 61 67 65 20 72 |embly la|nguage r|
|00005530| 6f 75 74 69 6e 65 2c 20 | 41 73 6d 43 6c 69 6b 4c |outine, |AsmClikL|
|00005540| 6f 6f 70 2c 20 77 68 69 | 63 68 20 69 73 20 69 6e |oop, whi|ch is in|
|00005550| 0d 2f 2f 20 74 75 72 6e | 20 63 61 6c 6c 65 64 20 |.// turn| called |
|00005560| 62 79 20 74 68 65 20 54 | 45 43 6c 69 63 6b 20 74 |by the T|EClick t|
|00005570| 6f 6f 6c 62 6f 78 20 72 | 6f 75 74 69 6e 65 2e 20 |oolbox r|outine. |
|00005580| 53 61 76 65 73 20 74 68 | 65 20 77 69 6e 64 6f 77 |Saves th|e window|
|00005590| 73 20 63 6c 69 70 20 72 | 65 67 69 6f 6e 2c 0d 2f |s clip r|egion,./|
|000055a0| 2f 20 73 65 74 73 20 69 | 74 20 74 6f 20 74 68 65 |/ sets i|t to the|
|000055b0| 20 70 6f 72 74 52 65 63 | 74 2c 20 61 64 6a 75 73 | portRec|t, adjus|
|000055c0| 74 73 20 74 68 65 20 73 | 63 72 6f 6c 6c 62 61 72 |ts the s|crollbar|
|000055d0| 20 76 61 6c 75 65 73 20 | 74 6f 20 6d 61 74 63 68 | values |to match|
|000055e0| 20 74 68 65 20 54 45 20 | 73 63 72 6f 6c 6c 0d 2f | the TE |scroll./|
|000055f0| 2f 20 61 6d 6f 75 6e 74 | 2c 20 74 68 65 6e 20 72 |/ amount|, then r|
|00005600| 65 73 74 6f 72 65 73 20 | 74 68 65 20 63 6c 69 70 |estores |the clip|
|00005610| 20 72 65 67 69 6f 6e 2e | 0d 0d 70 61 73 63 61 6c | region.|..pascal|
|00005620| 20 76 6f 69 64 20 50 61 | 73 63 61 6c 43 6c 69 6b | void Pa|scalClik|
|00005630| 4c 6f 6f 70 28 29 0d 7b | 0d 09 52 67 6e 48 61 6e |Loop().{|..RgnHan|
|00005640| 64 6c 65 09 72 65 67 69 | 6f 6e 3b 0d 09 57 69 6e |dle.regi|on;..Win|
|00005650| 64 6f 77 50 74 72 20 77 | 69 6e 64 3b 0d 09 54 45 |dowPtr w|ind;..TE|
|00005660| 44 6f 63 75 6d 65 6e 74 | 2a 20 64 6f 63 3b 0d 0d |Document|* doc;..|
|00005670| 09 77 69 6e 64 20 3d 20 | 46 72 6f 6e 74 57 69 6e |.wind = |FrontWin|
|00005680| 64 6f 77 28 29 3b 0d 09 | 64 6f 63 20 3d 20 28 54 |dow();..|doc = (T|
|00005690| 45 44 6f 63 75 6d 65 6e | 74 2a 29 20 28 67 54 68 |EDocumen|t*) (gTh|
|000056a0| 65 41 70 70 6c 69 63 61 | 74 69 6f 6e 2d 3e 44 6f |eApplica|tion->Do|
|000056b0| 63 4c 69 73 74 28 29 29 | 2d 3e 46 69 6e 64 44 6f |cList())|->FindDo|
|000056c0| 63 28 77 69 6e 64 29 3b | 0d 09 72 65 67 69 6f 6e |c(wind);|..region|
|000056d0| 20 3d 20 4e 65 77 52 67 | 6e 28 29 3b 0d 09 47 65 | = NewRg|n();..Ge|
|000056e0| 74 43 6c 69 70 28 72 65 | 67 69 6f 6e 29 3b 09 2f |tClip(re|gion);./|
|000056f0| 2f 20 73 61 76 65 20 63 | 6c 69 70 0d 09 43 6c 69 |/ save c|lip..Cli|
|00005700| 70 52 65 63 74 28 26 77 | 69 6e 64 2d 3e 70 6f 72 |pRect(&w|ind->por|
|00005710| 74 52 65 63 74 29 3b 0d | 09 64 6f 63 2d 3e 41 64 |tRect);.|.doc->Ad|
|00005720| 6a 75 73 74 53 63 72 6f | 6c 6c 56 61 6c 75 65 73 |justScro|llValues|
|00005730| 28 66 61 6c 73 65 29 3b | 0d 09 53 65 74 43 6c 69 |(false);|..SetCli|
|00005740| 70 28 72 65 67 69 6f 6e | 29 3b 09 2f 2f 20 72 65 |p(region|);.// re|
|00005750| 73 74 6f 72 65 20 63 6c | 69 70 0d 09 44 69 73 70 |store cl|ip..Disp|
|00005760| 6f 73 65 52 67 6e 28 72 | 65 67 69 6f 6e 29 3b 0d |oseRgn(r|egion);.|
|00005770| 7d 20 2f 2f 20 50 61 73 | 63 61 6c 43 6c 69 6b 4c |} // Pas|calClikL|
|00005780| 6f 6f 70 0d 0d 2f 2f 20 | 47 65 74 73 20 63 61 6c |oop..// |Gets cal|
|00005790| 6c 65 64 20 66 72 6f 6d | 20 6f 75 72 20 61 73 73 |led from| our ass|
|000057a0| 65 6d 62 6c 79 20 6c 61 | 6e 67 75 61 67 65 20 72 |embly la|nguage r|
|000057b0| 6f 75 74 69 6e 65 2c 20 | 41 73 6d 43 6c 69 6b 4c |outine, |AsmClikL|
|000057c0| 6f 6f 70 2c 20 77 68 69 | 63 68 20 69 73 20 69 6e |oop, whi|ch is in|
|000057d0| 0d 2f 2f 20 74 75 72 6e | 20 63 61 6c 6c 65 64 20 |.// turn| called |
|000057e0| 62 79 20 74 68 65 20 54 | 45 43 6c 69 63 6b 20 74 |by the T|EClick t|
|000057f0| 6f 6f 6c 62 6f 78 20 72 | 6f 75 74 69 6e 65 2e 20 |oolbox r|outine. |
|00005800| 49 74 20 72 65 74 75 72 | 6e 73 20 74 68 65 20 61 |It retur|ns the a|
|00005810| 64 64 72 65 73 73 20 6f | 66 20 74 68 65 0d 2f 2f |ddress o|f the.//|
|00005820| 20 64 65 66 61 75 6c 74 | 20 63 6c 69 6b 4c 6f 6f | default| clikLoo|
|00005830| 70 20 72 6f 75 74 69 6e | 65 20 74 68 61 74 20 77 |p routin|e that w|
|00005840| 61 73 20 70 75 74 20 69 | 6e 74 6f 20 74 68 65 20 |as put i|nto the |
|00005850| 54 45 52 65 63 20 62 79 | 20 54 45 41 75 74 6f 56 |TERec by| TEAutoV|
|00005860| 69 65 77 20 74 6f 0d 2f | 2f 20 41 73 6d 43 6c 69 |iew to./|/ AsmCli|
|00005870| 6b 4c 6f 6f 70 20 73 6f | 20 74 68 61 74 20 69 74 |kLoop so| that it|
|00005880| 20 63 61 6e 20 63 61 6c | 6c 20 69 74 2e 0d 0d 70 | can cal|l it...p|
|00005890| 61 73 63 61 6c 20 43 6c | 69 6b 4c 6f 6f 70 50 72 |ascal Cl|ikLoopPr|
|000058a0| 6f 63 50 74 72 20 47 65 | 74 4f 6c 64 43 6c 69 6b |ocPtr Ge|tOldClik|
|000058b0| 4c 6f 6f 70 28 29 0d 7b | 0d 09 54 45 44 6f 63 75 |Loop().{|..TEDocu|
|000058c0| 6d 65 6e 74 2a 20 64 6f | 63 3b 0d 0d 09 64 6f 63 |ment* do|c;...doc|
|000058d0| 20 3d 20 28 54 45 44 6f | 63 75 6d 65 6e 74 2a 29 | = (TEDo|cument*)|
|000058e0| 20 28 67 54 68 65 41 70 | 70 6c 69 63 61 74 69 6f | (gTheAp|plicatio|
|000058f0| 6e 2d 3e 44 6f 63 4c 69 | 73 74 28 29 29 2d 3e 46 |n->DocLi|st())->F|
|00005900| 69 6e 64 44 6f 63 28 46 | 72 6f 6e 74 57 69 6e 64 |indDoc(F|rontWind|
|00005910| 6f 77 28 29 29 3b 0d 09 | 69 66 20 28 64 6f 63 20 |ow());..|if (doc |
|00005920| 3d 3d 20 6e 69 6c 29 0d | 09 20 20 72 65 74 75 72 |== nil).|. retur|
|00005930| 6e 20 6e 69 6c 3b 0d 09 | 72 65 74 75 72 6e 20 64 |n nil;..|return d|
|00005940| 6f 63 2d 3e 47 65 74 43 | 6c 69 6b 4c 6f 6f 70 28 |oc->GetC|likLoop(|
|00005950| 29 3b 0d 7d 20 2f 2f 20 | 47 65 74 4f 6c 64 43 6c |);.} // |GetOldCl|
|00005960| 69 6b 4c 6f 6f 70 0d 00 | 00 00 00 00 00 00 00 00 |ikLoop..|........|
|00005970| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005980| 00 00 01 00 00 00 04 f2 | 00 00 03 f2 00 00 00 4a |........|.......J|
|00005990| 47 46 00 00 00 18 00 1e | 00 0a 01 1c 01 12 00 01 |GF......|........|
|000059a0| 00 00 00 00 00 00 00 00 | c1 82 03 53 43 57 00 00 |........|...SCW..|
|000059b0| 0d 54 45 44 6f 63 75 6d | 65 6e 74 2e 63 70 02 00 |.TEDocum|ent.cp..|
|000059c0| 00 00 54 45 58 54 4d 50 | 53 20 01 00 00 50 00 00 |..TEXTMP|S ...P..|
|000059d0| 00 00 54 45 58 54 4d 50 | 53 20 01 00 00 50 00 00 |..TEXTMP|S ...P..|
|000059e0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|000059f0| 00 00 a2 64 55 8c 00 00 | 00 00 00 00 05 3c 00 15 |...dU...|.....<..|
|00005a00| 00 1e 00 0a 01 1c 01 12 | 00 01 00 00 00 00 00 00 |........|........|
|00005a10| 00 00 c1 8a 00 00 00 00 | 18 00 1e 00 0a 01 1c 01 |........|........|
|00005a20| 12 00 01 00 00 00 00 00 | 00 00 00 c1 8b 03 53 43 |........|......SC|
|00005a30| 57 00 00 01 00 06 07 e0 | fc 0c 0f f1 8c 08 18 19 |W.......|........|
|00005a40| 8c 77 18 19 8c ff 80 19 | 9d fe 0f f9 ae fe 1f f8 |.w......|........|
|00005a50| cc ff 98 18 00 ff 98 18 | 00 7f 18 18 0c 36 18 18 |........|.....6..|
|00005a60| 18 00 18 18 10 06 18 1e | 6e 0c 0f fe ff 08 07 fd |........|n.......|
|00005a70| fc 77 00 01 fc ff 80 01 | ff fe 00 01 ff fe 0c 00 |.w......|........|
|00005a80| 00 00 00 1e 00 50 00 20 | 01 dd 02 3d 00 50 00 20 |.....P. |...=.P. |
|00005a90| 01 dd 02 3d 00 00 05 0a | 00 00 00 00 00 00 00 00 |...=....|........|
|00005aa0| 00 00 00 00 00 48 00 09 | 4d 6f 6e 61 63 6f 00 00 |.....H..|Monaco..|
|00005ab0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005ac0| 00 00 00 00 00 00 00 00 | 00 06 00 04 00 2a 00 05 |........|.....*..|
|00005ad0| 01 d3 02 5d 00 2a 00 05 | 01 d3 02 5d a2 61 20 a5 |...].*..|...].a .|
|00005ae0| 00 00 00 00 00 00 00 00 | 00 00 00 00 01 00 00 00 |........|........|
|00005af0| 03 80 00 1e 00 00 0d 9b | 00 00 0d b1 17 54 45 44 |........|.....TED|
|00005b00| 6f 63 75 6d 65 6e 74 3a | 3a 54 45 44 6f 63 75 6d |ocument:|:TEDocum|
|00005b10| 65 6e 74 00 00 00 11 6d | 00 00 11 84 17 54 45 44 |ent....m|.....TED|
|00005b20| 6f 63 75 6d 65 6e 74 3a | 3a 7e 54 45 44 6f 63 75 |ocument:|:~TEDocu|
|00005b30| 6d 65 6e 74 00 00 12 d3 | 00 00 12 e5 13 54 45 44 |ment....|.....TED|
|00005b40| 6f 63 75 6d 65 6e 74 3a | 3a 44 6f 5a 6f 6f 6d 00 |ocument:|:DoZoom.|
|00005b50| 00 00 14 fc 00 00 15 0e | 13 54 45 44 6f 63 75 6d |........|.TEDocum|
|00005b60| 65 6e 74 3a 3a 44 6f 47 | 72 6f 77 00 00 00 18 67 |ent::DoG|row....g|
|00005b70| 00 00 18 7c 15 54 45 44 | 6f 63 75 6d 65 6e 74 3a |...|.TED|ocument:|
|00005b80| 3a 44 6f 43 6f 6e 74 65 | 6e 74 00 00 1d 68 00 00 |:DoConte|nt...h..|
|00005b90| 1d 7d 15 54 45 44 6f 63 | 75 6d 65 6e 74 3a 3a 44 |.}.TEDoc|ument::D|
|00005ba0| 6f 4b 65 79 44 6f 77 6e | 00 00 1f 8a 00 00 1f a0 |oKeyDown|........|
|00005bb0| 17 54 45 44 6f 63 75 6d | 65 6e 74 3a 3a 44 6f 41 |.TEDocum|ent::DoA|
|00005bc0| 63 74 69 76 61 74 65 00 | 00 00 26 52 00 00 26 66 |ctivate.|..&R..&f|
|00005bd0| 15 54 45 44 6f 63 75 6d | 65 6e 74 3a 3a 44 6f 55 |.TEDocum|ent::DoU|
|00005be0| 70 64 61 74 65 00 00 00 | 28 8c 00 00 28 9e 13 54 |pdate...|(...(..T|
|00005bf0| 45 44 6f 63 75 6d 65 6e | 74 3a 3a 44 6f 49 64 6c |EDocumen|t::DoIdl|
|00005c00| 65 00 00 00 28 f6 00 00 | 29 0c 17 54 45 44 6f 63 |e...(...|)..TEDoc|
|00005c10| 75 6d 65 6e 74 3a 3a 44 | 72 61 77 57 69 6e 64 6f |ument::D|rawWindo|
|00005c20| 77 00 00 00 2a 42 00 00 | 2a 57 15 54 45 44 6f 63 |w...*B..|*W.TEDoc|
|00005c30| 75 6d 65 6e 74 3a 3a 47 | 65 74 54 45 52 65 63 74 |ument::G|etTERect|
|00005c40| 00 00 2b 98 00 00 2b af | 17 54 45 44 6f 63 75 6d |..+...+.|.TEDocum|
|00005c50| 65 6e 74 3a 3a 47 65 74 | 56 69 73 54 45 52 67 6e |ent::Get|VisTERgn|
|00005c60| 00 00 31 b4 00 00 31 cd | 19 54 45 44 6f 63 75 6d |..1...1.|.TEDocum|
|00005c70| 65 6e 74 3a 3a 48 61 76 | 65 53 65 6c 65 63 74 69 |ent::Hav|eSelecti|
|00005c80| 6f 6e 00 00 32 ad 00 00 | 32 c7 1b 54 45 44 6f 63 |on..2...|2..TEDoc|
|00005c90| 75 6d 65 6e 74 3a 3a 41 | 64 6a 75 73 74 56 69 65 |ument::A|djustVie|
|00005ca0| 77 52 65 63 74 00 00 00 | 34 61 00 00 34 75 15 54 |wRect...|4a..4u.T|
|00005cb0| 45 44 6f 63 75 6d 65 6e | 74 3a 3a 41 64 6a 75 73 |EDocumen|t::Adjus|
|00005cc0| 74 54 45 00 00 00 36 25 | 00 00 36 42 1d 54 45 44 |tTE...6%|..6B.TED|
|00005cd0| 6f 63 75 6d 65 6e 74 3a | 3a 41 64 6a 75 73 74 53 |ocument:|:AdjustS|
|00005ce0| 63 72 6f 6c 6c 53 69 7a | 65 73 00 00 3a 11 00 00 |crollSiz|es..:...|
|00005cf0| 3a 2d 1d 54 45 44 6f 63 | 75 6d 65 6e 74 3a 3a 41 |:-.TEDoc|ument::A|
|00005d00| 64 6a 75 73 74 53 63 72 | 6f 6c 6c 62 61 72 73 00 |djustScr|ollbars.|
|00005d10| 00 00 3d b0 00 00 3d c4 | 15 54 45 44 6f 63 75 6d |..=...=.|.TEDocum|
|00005d20| 65 6e 74 3a 3a 41 64 6a | 75 73 74 48 56 00 00 00 |ent::Adj|ustHV...|
|00005d30| 43 2d 00 00 43 4b 1f 54 | 45 44 6f 63 75 6d 65 6e |C-..CK.T|EDocumen|
|00005d40| 74 3a 3a 41 64 6a 75 73 | 74 53 63 72 6f 6c 6c 56 |t::Adjus|tScrollV|
|00005d50| 61 6c 75 65 73 00 00 00 | 43 c6 00 00 43 dd 17 54 |alues...|C...C..T|
|00005d60| 45 44 6f 63 75 6d 65 6e | 74 3a 3a 47 65 74 43 6c |EDocumen|t::GetCl|
|00005d70| 69 6b 4c 6f 6f 70 00 00 | 44 00 00 00 44 17 17 54 |ikLoop..|D...D..T|
|00005d80| 45 44 6f 63 75 6d 65 6e | 74 3a 3a 47 65 74 54 45 |EDocumen|t::GetTE|
|00005d90| 48 61 6e 64 6c 65 00 00 | 44 34 00 00 44 45 11 54 |Handle..|D4..DE.T|
|00005da0| 45 44 6f 63 75 6d 65 6e | 74 3a 3a 44 6f 43 75 74 |EDocumen|t::DoCut|
|00005db0| 00 00 45 c7 00 00 45 d9 | 13 54 45 44 6f 63 75 6d |..E...E.|.TEDocum|
|00005dc0| 65 6e 74 3a 3a 44 6f 43 | 6f 70 79 00 00 00 46 cb |ent::DoC|opy...F.|
|00005dd0| 00 00 46 de 13 54 45 44 | 6f 63 75 6d 65 6e 74 3a |..F..TED|ocument:|
|00005de0| 3a 44 6f 50 61 73 74 65 | 00 00 49 db 00 00 49 ee |:DoPaste|..I...I.|
|00005df0| 13 54 45 44 6f 63 75 6d | 65 6e 74 3a 3a 44 6f 43 |.TEDocum|ent::DoC|
|00005e00| 6c 65 61 72 00 00 4c 72 | 00 00 4c 7e 0d 43 6f 6d |lear..Lr|..L~.Com|
|00005e10| 6d 6f 6e 41 63 74 69 6f | 6e 00 00 00 4e 30 00 00 |monActio|n...N0..|
|00005e20| 4e 3b 0b 56 41 63 74 69 | 6f 6e 50 72 6f 63 00 00 |N;.VActi|onProc..|
|00005e30| 51 b2 00 00 51 bd 0b 48 | 41 63 74 69 6f 6e 50 72 |Q...Q..H|ActionPr|
|00005e40| 6f 63 00 00 55 a6 00 00 | 55 b4 0f 50 61 73 63 61 |oc..U...|U..Pasca|
|00005e50| 6c 43 6c 69 6b 4c 6f 6f | 70 00 00 00 58 26 00 00 |lClikLoo|p...X&..|
|00005e60| 58 34 0f 47 65 74 4f 6c | 64 43 6c 69 6b 4c 6f 6f |X4.GetOl|dClikLoo|
|00005e70| 70 00 00 00 01 00 00 00 | 04 f2 00 00 03 f2 00 00 |p.......|........|
|00005e80| 00 4a 00 34 5b 34 06 fc | 00 00 00 1c 00 4a 00 00 |.J.4[4..|.....J..|
|00005e90| 4d 50 53 52 00 02 00 0a | 03 f0 ff ff 00 00 00 00 |MPSR....|........|
|00005ea0| 00 00 00 00 03 ed ff ff | 00 00 00 22 00 00 00 00 |........|..."....|
|00005eb0| 03 ef ff ff 00 00 00 6e | 00 36 4f 48 00 00 00 00 |.......n|.6OH....|
|00005ec0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005ed0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005ee0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00005ef0| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+